From a12144bf61d93d8ddc4b49308a25eaafc7481039 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 7 Nov 2021 13:57:24 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Philipp --- mod/photos.php | 2 +- mod/tagger.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 6cfdd6a99..b4ffb756c 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -204,7 +204,7 @@ function photos_post(App $a) } // RENAME photo album - $newalbum = trim($_POST['albumname']); + $newalbum = trim($_POST['albumname'] ?? ''); if ($newalbum != $album) { Photo::update(['album' => $newalbum], ['album' => $album, 'uid' => $page_owner_uid]); // Update the photo albums cache diff --git a/mod/tagger.php b/mod/tagger.php index 4afe6efb6..d55e34f78 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -41,7 +41,7 @@ function tagger_content(App $a) { return; } - $term = trim($_GET['term']); + $term = trim($_GET['term'] ?? ''); // no commas allowed $term = str_replace([',',' ', '<', '>'],['','_', '', ''], $term);