Code Duplication    Length = 3-7 lines in 3 locations

classes/PodsAPI.php 2 locations

@@ 7135-7141 (lines=7) @@
7132
		$info = array();
7133
7134
		if ( 'pod' == $object_type && null === $pod ) {
7135
			if ( empty( $name ) ) {
7136
				$prefix = 'pod-';
7137
7138
				// Make sure we actually have the prefix before trying anything with the name
7139
				if ( 0 === strpos( $object_type, $prefix ) )
7140
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7141
			}
7142
7143
			if ( empty( $name ) && !empty( $object ) )
7144
				$name = $object;
@@ 7184-7190 (lines=7) @@
7181
			$info[ 'pod' ] = $pod;
7182
7183
		if ( 0 === strpos( $object_type, 'pod' ) ) {
7184
			if ( empty( $name ) ) {
7185
				$prefix = 'pod-';
7186
7187
				// Make sure we actually have the prefix before trying anything with the name
7188
				if ( 0 === strpos( $object_type, $prefix ) )
7189
					$name = substr( $object_type, strlen( $prefix ), strlen( $object_type ) );
7190
			}
7191
7192
			$info[ 'type' ] = 'pod';
7193
			global $wpdb;

includes/data.php 1 location

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