Commit 34329111 authored by Kevin Langley's avatar Kevin Langley
Browse files

checking if file_exists before attempting to get image size

parent 48ed24d4
......@@ -204,6 +204,8 @@ if( !class_exists( 'CDN_Rewrite' ) ){
}
private function get_version($url) {
$version = false;
if(0 === strpos($url, $this->root_url)) {
$parts = parse_url($url);
foreach( array( 'scheme', 'host', 'path' ) as $part ){
......@@ -212,12 +214,12 @@ if( !class_exists( 'CDN_Rewrite' ) ){
}
$file_path = str_replace( site_url('/'), ABSPATH, $parts['scheme'] . '://' . $parts['host'] . $parts['path'] );
if( !($version = @filemtime($file_path)) ) {
if( file_exists( $file_path ) && !($version = @filemtime($file_path)) ) {
$version = $this->default_version;
}
return $version;
}
return false;
return $version;
}
public function replace_version($src) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment