`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
1 changed files with 7 additions and 4 deletions

View File

@ -219,16 +219,19 @@ class WP_Scripts extends WP_Dependencies {
} }
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;
} }