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

@@ 7317-7323 (lines=7) @@
7314
		$info = array();
7315
7316
		if ( 'pod' == $object_type && null === $pod ) {
7317
			if ( empty( $name ) ) {
7318
				$prefix = 'pod-';
7319
7320
				// Make sure we actually have the prefix before trying anything with the name
7321
				if ( 0 === strpos( $object_type, $prefix ) )
7322
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7323
			}
7324
7325
			if ( empty( $name ) && !empty( $object ) )
7326
				$name = $object;
@@ 7366-7372 (lines=7) @@
7363
			$info[ 'pod' ] = $pod;
7364
7365
		if ( 0 === strpos( $object_type, 'pod' ) ) {
7366
			if ( empty( $name ) ) {
7367
				$prefix = 'pod-';
7368
7369
				// Make sure we actually have the prefix before trying anything with the name
7370
				if ( 0 === strpos( $object_type, $prefix ) )
7371
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7372
			}
7373
7374
			$info[ 'type' ] = 'pod';
7375
			global $wpdb;