Quick fix for Wikipedia archives issues #6.

This commit is contained in:
Eric van der Vlist 2012-01-28 11:16:17 +01:00
parent 6332cf69a5
commit eef5297f98
1 changed files with 8 additions and 1 deletions

View File

@ -439,7 +439,14 @@ if (!class_exists("Owark")) {
$loc = '/wp-content/plugins/owark' . substr($link->arc_location, $pos); $loc = '/wp-content/plugins/owark' . substr($link->arc_location, $pos);
$arc_loc = home_url() . $loc; $arc_loc = home_url() . $loc;
// The file name is either index.html or guessed from the URL
if ($home_url[strlen($home_url)] == '/') {
$file_location = '.'. $loc .'/index.html'; $file_location = '.'. $loc .'/index.html';
} else {
$parts = str_split($home_url, '/');
$file_location = '.'. $loc . $parts[count($parts)] . '.html';
}
if (!file_exists($file_location)) { if (!file_exists($file_location)) {
// If index.html doesn't exist, find another html file! // If index.html doesn't exist, find another html file!
$dir = opendir('.'.$loc); $dir = opendir('.'.$loc);