Code Duplication    Length = 3-7 lines in 3 locations

classes/PodsAPI.php 2 locations

@@ 7463-7469 (lines=7) @@
7460
		$info = array();
7461
7462
		if ( 'pod' == $object_type && null === $pod ) {
7463
			if ( empty( $name ) ) {
7464
				$prefix = 'pod-';
7465
7466
				// Make sure we actually have the prefix before trying anything with the name
7467
				if ( 0 === strpos( $object_type, $prefix ) )
7468
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7469
			}
7470
7471
			if ( empty( $name ) && !empty( $object ) )
7472
				$name = $object;
@@ 7512-7518 (lines=7) @@
7509
			$info[ 'pod' ] = $pod;
7510
7511
		if ( 0 === strpos( $object_type, 'pod' ) ) {
7512
			if ( empty( $name ) ) {
7513
				$prefix = 'pod-';
7514
7515
				// Make sure we actually have the prefix before trying anything with the name
7516
				if ( 0 === strpos( $object_type, $prefix ) )
7517
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7518
			}
7519
7520
			$info[ 'type' ] = 'pod';
7521
			global $wpdb;

includes/data.php 1 location

@@ 400-402 (lines=3) @@
397
				$url_raw = pods_current_url();
398
				$prefix  = get_site_url();
399
400
				if ( substr( $url_raw, 0, strlen( $prefix ) ) == $prefix ) {
401
					$url_raw = substr( $url_raw, strlen( $prefix ) + 1, strlen( $url_raw ) );
402
				}
403
404
				$url = parse_url( $url_raw );
405
				$uri = trim( $url[ 'path' ], '/' );