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">
|
<datalist id="list_tags">
|
||||||
<?php
|
<?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));
|
while(!feof($file))
|
||||||
if ($tag != "")
|
|
||||||
{
|
{
|
||||||
printf("<option value=\"%s\">\n", $tag);
|
$tag = rtrim(fgets($file));
|
||||||
|
if ($tag != "")
|
||||||
|
{
|
||||||
|
printf("<option value=\"%s\">\n", $tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fclose($file);
|
||||||
}
|
}
|
||||||
fclose($file);
|
|
||||||
?>
|
?>
|
||||||
</datalist>
|
</datalist>
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in New Issue