X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=b2f4ded57adc6046c6d5a242b42b3194b78ba5ca;hb=a74f52a8d206a6d5c3fe27667f1633bf2fc1374d;hp=7df6d819ef4edc12ad95e66e659c21897beb88e3;hpb=fc27141cf6eb04d3d8714385cb6961a8063fe61b;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 7df6d819..b2f4ded5 100644 --- a/index.php +++ b/index.php @@ -1320,10 +1320,17 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) die('Wrong token.'); } - if (strpos($_GET['lf_linkdate'], ' ') !== false) { - $ids = array_values(array_filter(preg_split('/\s+/', escape($_GET['lf_linkdate'])))); + $ids = trim($_GET['lf_linkdate']); + if (strpos($ids, ' ') !== false) { + // multiple, space-separated ids provided + $ids = array_values(array_filter(preg_split('/\s+/', escape($ids)))); } else { - $ids = [$_GET['lf_linkdate']]; + // only a single id provided + $ids = [$ids]; + } + // assert at least one id is given + if(!count($ids)){ + die('no id provided'); } foreach ($ids as $id) { $id = (int) escape($id);