From 4e8782ebc622a4b9644f09998054b15bd49eef8f Mon Sep 17 00:00:00 2001 From: Dmitri Popov Date: Wed, 13 Oct 2021 16:09:59 +0200 Subject: [PATCH] Fix xss (#31) Fix XSS on index through "d" param and "photo" param Co-authored-by: JoMar --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index c18e07d..d2baf6f 100644 --- a/index.php +++ b/index.php @@ -99,8 +99,8 @@ function read_gps_location($file) echo ("

Directory doesn't exist

    -
  • Create $photo_dir and " . $photo_dir . "tims directories.
  • -
  • Add photos to the $photo_dir directory.
  • +
  • Create " . htmlentities($photo_dir) . " and " . htmlentities($photo_dir) . "tims directories.
  • +
  • Add photos to the " . htmlentities($photo_dir) . " directory.
  • Refresh this page.
"); exit; @@ -357,7 +357,7 @@ function show_pagination($current_page, $last_page, $sub_photo_dir) $info = "" . $photo_info . ""; $Parsedown = new Parsedown(); // Show photo, EXIF data, description, and info - echo '

' . $comment . ' ' . $Parsedown->text($description) . '


' . $info . '

'; + echo '

' . $comment . ' ' . $Parsedown->text($description) . '


' . $info . '

'; } // Show links