WP_Scripts->in_default_dir() should use the WPINC constant

Props wojtek.szkutnik
See #14157.

Built from https://develop.svn.wordpress.org/trunk@28907


git-svn-id: http://core.svn.wordpress.org/trunk@28706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-29 22:23:15 +00:00
parent 0ef5c92164
commit 53968da5e2

View File

@ -218,16 +218,19 @@ class WP_Scripts extends WP_Dependencies {
return $this->done; return $this->done;
} }
public function in_default_dir($src) { public function in_default_dir( $src ) {
if ( ! $this->default_dirs ) if ( ! $this->default_dirs ) {
return true; return true;
}
if ( 0 === strpos( $src, '/wp-includes/js/l10n' ) ) if ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) {
return false; return false;
}
foreach ( (array) $this->default_dirs as $test ) { foreach ( (array) $this->default_dirs as $test ) {
if ( 0 === strpos($src, $test) ) if ( 0 === strpos( $src, $test ) ) {
return true; return true;
}
} }
return false; return false;
} }