Fixing #9
This commit is contained in:
parent
5acb10101f
commit
f907af85c7
|
@ -450,20 +450,26 @@ if (!class_exists("Owark")) {
|
||||||
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);
|
||||||
while (false !== ($file = readdir($dir))) {
|
if ($dir) {
|
||||||
if ('.html' === substr($file, strlen($file) - 5)) {
|
while (false !== ($file = readdir($dir))) {
|
||||||
$file_location = '.'.$loc.'/' . $file;
|
if ('.html' === substr($file, strlen($file) - 5)) {
|
||||||
break;
|
$file_location = '.'.$loc.'/' . $file;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
closedir($dir);
|
||||||
}
|
}
|
||||||
closedir($dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the file
|
// Read the file
|
||||||
|
|
||||||
$f = fopen($file_location, "r");
|
if (file_exists($file_location)) {
|
||||||
$content = fread($f, filesize($file_location));
|
$f = fopen($file_location, "r");
|
||||||
fclose($f);
|
$content = fread($f, filesize($file_location));
|
||||||
|
fclose($f);
|
||||||
|
} else {
|
||||||
|
$content = 'Archive not found';
|
||||||
|
}
|
||||||
|
|
||||||
// Which encoding?
|
// Which encoding?
|
||||||
$encoding = $link->encoding;
|
$encoding = $link->encoding;
|
||||||
|
|
Loading…
Reference in New Issue