Don't die if file tags.lst doesn't exist.

die() cuts the document at the position of the error. We just return an
empty datalist.
This commit is contained in:
tastytea 2021-01-21 22:20:54 +01:00
parent 55ea37eb9b
commit 353a16847f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 6 deletions

View File

@ -292,7 +292,8 @@
<datalist id="list_tags">
<?php
$file = fopen("tags.lst", "r") or die("Unable to open autocompletion file.");
if ($file = fopen("tags.lst", "r"))
{
while(!feof($file))
{
$tag = rtrim(fgets($file));
@ -302,6 +303,7 @@
}
}
fclose($file);
}
?>
</datalist>
</body>