Code Duplication    Length = 3-7 lines in 3 locations

includes/data.php 1 location

@@ 418-420 (lines=3) @@
415
				$url_raw = pods_current_url();
416
				$prefix  = get_site_url();
417
418
				if ( substr( $url_raw, 0, strlen( $prefix ) ) == $prefix ) {
419
					$url_raw = substr( $url_raw, strlen( $prefix ) + 1, strlen( $url_raw ) );
420
				}
421
422
				$url = parse_url( $url_raw );
423
				$uri = trim( $url[ 'path' ], '/' );

classes/PodsAPI.php 2 locations

@@ 7372-7378 (lines=7) @@
7369
		$info = array();
7370
7371
		if ( 'pod' == $object_type && null === $pod ) {
7372
			if ( empty( $name ) ) {
7373
				$prefix = 'pod-';
7374
7375
				// Make sure we actually have the prefix before trying anything with the name
7376
				if ( 0 === strpos( $object_type, $prefix ) )
7377
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7378
			}
7379
7380
			if ( empty( $name ) && !empty( $object ) )
7381
				$name = $object;
@@ 7421-7427 (lines=7) @@
7418
			$info[ 'pod' ] = $pod;
7419
7420
		if ( 0 === strpos( $object_type, 'pod' ) ) {
7421
			if ( empty( $name ) ) {
7422
				$prefix = 'pod-';
7423
7424
				// Make sure we actually have the prefix before trying anything with the name
7425
				if ( 0 === strpos( $object_type, $prefix ) )
7426
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7427
			}
7428
7429
			$info[ 'type' ] = 'pod';
7430
			global $wpdb;