diff --git a/www/index.php b/www/index.php index 3b7e777..9ab9293 100644 --- a/www/index.php +++ b/www/index.php @@ -292,7 +292,7 @@ function getFileMetadata( $dsn, $url ) return $metadata; } -function getOtherVersionUrls( $url ) +function getOtherWordpressVersionUrls( $url ) { global $dsn; $path = parse_url($url, PHP_URL_PATH); @@ -450,12 +450,6 @@ function handle404( $sourcePath, $url ) http_response_code( 301 ); exit( 0 ); break; - case ( $LOADER['WORDPRESS_FIX_MISSING_VERSION'] ) : - $otherVersionFound = getOtherVersionUrls($url); - if ( $otherVersionFound ) { - render( $otherVersionFound, $sourcePath, $url ); - break; - } default: http_response_code( 404 ); } @@ -612,7 +606,12 @@ try { exit( 0 ); } if ( $LOADER['ARCHIVARIX_LOADER_MODE'] == 0 ) { - handle404( $sourcePath, $url ); + if ( $LOADER['WORDPRESS_FIX_MISSING_VERSION'] && ($otherVersionFound = getOtherWordpressVersionUrls($url)) ) { + render( $otherVersionFound, $sourcePath, $url ); + } else { + handle404( $sourcePath, $url ); + exit( 0 ); + } } if ( $LOADER['ARCHIVARIX_LOADER_MODE'] > 0 ) { include __DIR__ . DIRECTORY_SEPARATOR . 'index.php';