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

@@ 7405-7411 (lines=7) @@
7402
		$info = array();
7403
7404
		if ( 'pod' == $object_type && null === $pod ) {
7405
			if ( empty( $name ) ) {
7406
				$prefix = 'pod-';
7407
7408
				// Make sure we actually have the prefix before trying anything with the name
7409
				if ( 0 === strpos( $object_type, $prefix ) )
7410
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7411
			}
7412
7413
			if ( empty( $name ) && !empty( $object ) )
7414
				$name = $object;
@@ 7454-7460 (lines=7) @@
7451
			$info[ 'pod' ] = $pod;
7452
7453
		if ( 0 === strpos( $object_type, 'pod' ) ) {
7454
			if ( empty( $name ) ) {
7455
				$prefix = 'pod-';
7456
7457
				// Make sure we actually have the prefix before trying anything with the name
7458
				if ( 0 === strpos( $object_type, $prefix ) )
7459
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7460
			}
7461
7462
			$info[ 'type' ] = 'pod';
7463
			global $wpdb;