make sure index.php exists before sha1'ing it

This commit is contained in:
Ben Harris 2018-12-10 02:23:55 -05:00
parent cc3521e19a
commit 5041ab536a
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
1 changed files with 3 additions and 2 deletions

View File

@ -94,8 +94,9 @@ $parser = new Mni\FrontYAML\Parser();
<ul>
<?php
foreach (glob("/home/*") as $user):
if (!is_dir("$user/public_html")
|| sha1_file("/etc/skel/public_html/index.php") == sha1_file("$user/public_html/index.php"))
if (!is_dir("$user/public_html")
|| (file_exists("$user/public_html/index.php")
&& sha1_file("/etc/skel/public_html/index.php") == sha1_file("$user/public_html/index.php")))
continue;
$user = basename($user); ?>
<li style="list-style: none; margin-left: -40px;">