Projects
/
nettsiden-old
Archived
8
0
Fork 0

Performance, input sanitization, cleanup

This commit is contained in:
Felix Albrigtsen 2022-01-25 09:05:34 +01:00
parent 9e7436684c
commit c57276b779
3 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,3 @@
bilder/slideshow/*.* bilder/slideshow/*
!/bilder/slideshow/.gitkeep bilder/pvv-photos/
bilder/pvv-photos
usernames.txt usernames.txt

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
outfolder="bilder/pvv-photos" outfolder="bilder/pvv-photos"
folders=$(find /home/pvv -maxdepth 3 -name 'pvv-photos' 2>/dev/null) folders=$(ssh pvv@microbel.pvv.ntnu.no -i /home/pvv/c/pvv/.ssh/photofetcher 'find /home/pvv -maxdepth 3 -name "pvv-photos" 2>/dev/null')
unamefile="usernames.txt" unamefile="usernames.txt"
> $unamefile # Empty the file > $unamefile # Empty the file

View File

@ -110,12 +110,12 @@ $imageTemplate = '
} }
$vars = [ $vars = [
"%user" => $imguser, "%user" => htmlspecialchars($imguser),
"%time" => $modTime, "%time" => $modTime,
"%timestamp" => filemtime($fullPath . $value), "%timestamp" => filemtime($fullPath . $value),
"%name" => $displaypath, "%name" => htmlspecialchars($displaypath),
"%path" => "/galleri/" . $relativePath .$value, "%path" => "/galleri/" . $relativePath .$value,
"%realname" => $realname "%realname" => $htmlspecialchars(realname)
]; ];
echo strtr($imageTemplate, $vars); echo strtr($imageTemplate, $vars);
} }