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:
parent
55ea37eb9b
commit
353a16847f
14
index.php
14
index.php
|
@ -292,16 +292,18 @@
|
|||
|
||||
<datalist id="list_tags">
|
||||
<?php
|
||||
$file = fopen("tags.lst", "r") or die("Unable to open autocompletion file.");
|
||||
while(!feof($file))
|
||||
if ($file = fopen("tags.lst", "r"))
|
||||
{
|
||||
$tag = rtrim(fgets($file));
|
||||
if ($tag != "")
|
||||
while(!feof($file))
|
||||
{
|
||||
printf("<option value=\"%s\">\n", $tag);
|
||||
$tag = rtrim(fgets($file));
|
||||
if ($tag != "")
|
||||
{
|
||||
printf("<option value=\"%s\">\n", $tag);
|
||||
}
|
||||
}
|
||||
fclose($file);
|
||||
}
|
||||
fclose($file);
|
||||
?>
|
||||
</datalist>
|
||||
</body>
|
||||
|
|
Reference in New Issue