Merge pull request #2277 from maxrice/patch-2

Use is_readable() for autoloading
This commit is contained in:
Mike Jolley 2013-01-23 12:03:12 -08:00
commit 650a6d95ec
1 changed files with 5 additions and 5 deletions

View File

@ -189,7 +189,7 @@ class Woocommerce {
$path = $this->plugin_path() . '/classes/gateways/' . trailingslashit( substr( str_replace( '_', '-', $class ), 11 ) );
$file = 'class-' . str_replace( '_', '-', $class ) . '.php';
if ( file_exists( $path . $file ) ) {
if ( is_readable( $path . $file ) ) {
include( $path . $file );
return;
}
@ -199,7 +199,7 @@ class Woocommerce {
$path = $this->plugin_path() . '/classes/shipping/' . trailingslashit( substr( str_replace( '_', '-', $class ), 12 ) );
$file = 'class-' . str_replace( '_', '-', $class ) . '.php';
if ( file_exists( $path . $file ) ) {
if ( is_readable( $path . $file ) ) {
include( $path . $file );
return;
}
@ -209,7 +209,7 @@ class Woocommerce {
$path = $this->plugin_path() . '/classes/shortcodes/';
$file = 'class-' . str_replace( '_', '-', $class ) . '.php';
if ( file_exists( $path . $file ) ) {
if ( is_readable( $path . $file ) ) {
include( $path . $file );
return;
}
@ -220,7 +220,7 @@ class Woocommerce {
$path = $this->plugin_path() . '/classes/';
$file = 'class-' . str_replace( '_', '-', $class ) . '.php';
if ( file_exists( $path . $file ) ) {
if ( is_readable( $path . $file ) ) {
include( $path . $file );
return;
}
@ -1980,4 +1980,4 @@ class Woocommerce {
*/
$GLOBALS['woocommerce'] = new Woocommerce();
} // class_exists check
} // class_exists check