From: Banana Date: Sat, 10 Dec 2022 20:47:01 +0000 (+0100) Subject: fixed #17 X-Git-Tag: v2.8~1 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=1025853908a22e9b6e255a49707b81a8cc9b1e4d;p=insipid.git fixed #17 fixed some new php8 defaults --- diff --git a/webroot/index.php b/webroot/index.php index 913f235..7602183 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -32,10 +32,10 @@ ini_set('error_reporting',-1); // E_ALL & E_STRICT # time settings date_default_timezone_set('Europe/Berlin'); -define('DEBUG',false); +define('DEBUG',true); ## check request -$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); +$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW); if(!empty($_urlToParse)) { # see http://de2.php.net/manual/en/regexp.reference.unicode.php if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) { @@ -116,7 +116,7 @@ if(!empty($TemplateData['refresh'])) { # header information header('Content-type: text/html; charset=UTF-8'); -if($Summoner::simpleAuthCheck() === true) { +if($Summoner::simpleAuthCheck() === true || !empty($TemplateData['nocacheHeader'])) { header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); diff --git a/webroot/lib/lang/eng.lang.ini b/webroot/lib/lang/eng.lang.ini index ef295b0..20a5b88 100644 --- a/webroot/lib/lang/eng.lang.ini +++ b/webroot/lib/lang/eng.lang.ini @@ -89,6 +89,7 @@ view.private = "Private" view.url = "URL" view.image = "Image" view.image.provided = "If provided" +view.image.noimage = "No image provided" view.date.added = "Date added" view.edit = "Edit" view.export = "Export" diff --git a/webroot/lib/lang/ger.lang.ini b/webroot/lib/lang/ger.lang.ini index 4547388..d542b4b 100644 --- a/webroot/lib/lang/ger.lang.ini +++ b/webroot/lib/lang/ger.lang.ini @@ -89,6 +89,7 @@ view.private = "Privat" view.url = "URL" view.image = "Bild" view.image.provided = "Wenn vorhanden" +view.image.noimage = "Kein Bild vorhanden" view.date.added = "Hinzugefügt am" view.edit = "Bearbeiten" view.export = "Export" diff --git a/webroot/view/editcategories.inc.php b/webroot/view/editcategories.inc.php index f38b240..8d1de3b 100644 --- a/webroot/view/editcategories.inc.php +++ b/webroot/view/editcategories.inc.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -25,8 +25,8 @@ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0. * */ -$submitFeedback = false; -$formData = false; +$submitFeedback = array(); +$formData = array(); # very simple security check. # can/should be extended in the future. diff --git a/webroot/view/editlink.inc.php b/webroot/view/editlink.inc.php index 5612805..a84fa0e 100644 --- a/webroot/view/editlink.inc.php +++ b/webroot/view/editlink.inc.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -26,8 +26,8 @@ * */ -$submitFeedback = false; -$formData = false; +$submitFeedback = array(); +$formData = array(); # very simple security check. # can/should be extended in the future. diff --git a/webroot/view/editlink.php b/webroot/view/editlink.php index a5eadbf..ee6539a 100644 --- a/webroot/view/editlink.php +++ b/webroot/view/editlink.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -88,7 +88,7 @@

- <?php echo $T->t('view.image.provided'); ?> + <?php echo $T->t('view.image.noimage'); ?>



diff --git a/webroot/view/edittags.inc.php b/webroot/view/edittags.inc.php index eb40228..ae3a12b 100644 --- a/webroot/view/edittags.inc.php +++ b/webroot/view/edittags.inc.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -25,8 +25,8 @@ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0. * */ -$submitFeedback = false; -$formData = false; +$submitFeedback = array(); +$formData = array(); # very simple security check. # can/should be extended in the future. diff --git a/webroot/view/home.inc.php b/webroot/view/home.inc.php index 463f4e8..a858581 100644 --- a/webroot/view/home.inc.php +++ b/webroot/view/home.inc.php @@ -3,7 +3,7 @@ * Insipid * Personal web-bookmark-system * - * Copyright 2016-2021 Johannes Keßler + * Copyright 2016-2022 Johannes Keßler * * Development starting from 2011: Johannes Keßler * https://www.bananas-playground.net/projekt/insipid/ @@ -28,12 +28,12 @@ $searchValue = false; $isUrl = false; -$submitFeedback = false; +$submitFeedback = array(); $queryStr = false; $searchResult = false; $showAddForm = false; -$formData = false; $honeypotCheck = false; +$formData = array(); $_requestMode = false; if(isset($_GET['m']) && !empty($_GET['m'])) { @@ -87,6 +87,8 @@ if(isset($_POST['data']) && !empty($_POST['data']) && isset($_POST['submitsearch # show the add form $showAddForm = true; $formData['url'] = $searchValue; + $formData['categories'] = array(); + $formData['tags'] = array(); } elseif(!empty($searchResult)) { # something has been found @@ -116,14 +118,18 @@ if(isset($_POST['data']) && !empty($_POST['data']) && isset($_POST['addnewone']) $formData['category'] = trim($fData['category']); $formData['tag'] = trim($fData['tag']); + # categories and tag stuff + $catArr = Summoner::prepareTagOrCategoryStr($formData['category']); + $tagArr = Summoner::prepareTagOrCategoryStr($formData['tag']); + $formData['categories'] = $catArr; + $formData['tags'] = $tagArr; + $isUrl = Summoner::validate($formData['url'],'url'); if($isUrl === true && !empty($formData['title'])) { $hash = md5($formData['url']); - # categories and tag stuff - $catArr = Summoner::prepareTagOrCategoryStr($formData['category']); - $tagArr = Summoner::prepareTagOrCategoryStr($formData['tag']); + $DB->begin_transaction(MYSQLI_TRANS_START_READ_WRITE); diff --git a/webroot/view/random.inc.php b/webroot/view/random.inc.php index 149f6c3..e1a16f2 100644 --- a/webroot/view/random.inc.php +++ b/webroot/view/random.inc.php @@ -29,3 +29,5 @@ $randomLink = $Management->randomLink(10); $randomCategory = $Management->randomCategory(10); $randomTag = $Management->randomTag(10); + +$TemplateData['nocacheHeader'] = true;