]> 91.132.146.200 Git - insipid.git/commitdiff
fixed #17
authorBanana <mail@bananas-playground.net>
Sat, 10 Dec 2022 20:47:01 +0000 (21:47 +0100)
committerBanana <mail@bananas-playground.net>
Sat, 10 Dec 2022 20:47:01 +0000 (21:47 +0100)
fixed some new php8 defaults

webroot/index.php
webroot/lib/lang/eng.lang.ini
webroot/lib/lang/ger.lang.ini
webroot/view/editcategories.inc.php
webroot/view/editlink.inc.php
webroot/view/editlink.php
webroot/view/edittags.inc.php
webroot/view/home.inc.php
webroot/view/random.inc.php

index 913f2359d164604e2e637599819ce3da7f1e7305..760218327607d4930d1516887440ba32092001d2 100644 (file)
@@ -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");
index ef295b0c1a90283cc54b88b0a66f58a03b9c2450..20a5b88ca6d1702bd8f11a19c38fafef5d6e801b 100644 (file)
@@ -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"
index 4547388f330b93cd7b6f75f8e00169e383cb7b5d..d542b4ba7cbe3969c51f280a4e16fc42b0262bfe 100644 (file)
@@ -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"
index f38b2408d2d44cd5317a6ff298a16f290d34bfdd..8d1de3b52aab46472637e33d5bdbb18244430245 100644 (file)
@@ -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.
index 56128057ad7b9fd0dc93c84f8e7dea60d48e208a..a84fa0ede8e444de247c8e12a5486ce1b17728a5 100644 (file)
@@ -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.
index a5eadbf77f5badf76dc6930839bb999f6d1b1f36..ee6539a4ef527ed348f9764690cf1ab838385ae8 100644 (file)
@@ -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 @@
                        </div>
                        <div class="column">
                                <p>
-                                       <img class="linkthumbnail" src="<?php echo $linkData['imageToShow']; ?>" alt="<?php echo $T->t('view.image.provided'); ?>">
+                                       <img class="linkthumbnail" src="<?php echo $linkData['imageToShow']; ?>" alt="<?php echo $T->t('view.image.noimage'); ?>">
                                </p>
                                <input class="input" type="text" name="data[image]" value="<?php echo Summoner::ifset($formData, 'image'); ?>" /><br />
                                <br />
index eb40228e9d0d885cb6e5dfd300957b55e7d9cc5e..ae3a12b51170b4c71d8a810ddca44866311ca14b 100644 (file)
@@ -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.
index 463f4e8af265db596b9667fe9d1f8882d7778b47..a858581709d4d4e77537ddd423ee0f5e11b42e91 100644 (file)
@@ -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/
 
 $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);
 
index 149f6c39a2d707fed5a735f81a885191e262e578..e1a16f2a706138db26d3db31a689da3b863d1a7e 100644 (file)
@@ -29,3 +29,5 @@
 $randomLink = $Management->randomLink(10);
 $randomCategory = $Management->randomCategory(10);
 $randomTag = $Management->randomTag(10);
+
+$TemplateData['nocacheHeader'] = true;