Browse code

simplify debug output, use print_r for everything

Bernd Wurst authored on31/01/2021 05:18:43
Showing1 changed files
... ...
@@ -22,11 +22,7 @@ function DEBUG($str)
22 22
 {
23 23
     global $debugmode;
24 24
     if ($debugmode) {
25
-        if (is_string($str)) {
26
-            echo htmlspecialchars($str) . "<br />\n";
27
-        } else {
28
-            echo "<pre>".htmlspecialchars(print_r($str, true))."</pre>\n";
29
-        }
25
+        echo "<pre>".htmlspecialchars(print_r($str, true))."</pre>\n";
30 26
     }
31 27
 }
32 28
 
Browse code

better guard debugging output against XSS (e.g. via array keys)

Hanno Böck authored on20/01/2021 13:18:32
Showing1 changed files
... ...
@@ -22,15 +22,10 @@ function DEBUG($str)
22 22
 {
23 23
     global $debugmode;
24 24
     if ($debugmode) {
25
-        if (is_array($str)) {
26
-            array_walk_recursive($str, function (&$v) {
27
-                $v = htmlspecialchars($v);
28
-            });
29
-            echo "<pre>".print_r($str, true)."</pre>\n";
30
-        } elseif (is_object($str)) {
31
-            echo "<pre>".print_r($str, true)."</pre>\n";
32
-        } else {
25
+        if (is_string($str)) {
33 26
             echo htmlspecialchars($str) . "<br />\n";
27
+        } else {
28
+            echo "<pre>".htmlspecialchars(print_r($str, true))."</pre>\n";
34 29
         }
35 30
     }
36 31
 }
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on26/06/2018 13:58:19
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 9
 To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 14
 Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
... ...
@@ -20,19 +20,20 @@ $debugmode = (isset($_GET['debug']) && config('enable_debug'));
20 20
 
21 21
 function DEBUG($str)
22 22
 {
23
-  global $debugmode;
24
-  if ($debugmode)
25
-    if (is_array($str)) {
26
-      array_walk_recursive($str, function(&$v) { $v = htmlspecialchars($v); });
27
-      echo "<pre>".print_r($str, true)."</pre>\n";
28
-    } elseif (is_object($str)) {
29
-      echo "<pre>".print_r($str, true)."</pre>\n";
30
-    } else {
31
-      echo htmlspecialchars($str) . "<br />\n";
23
+    global $debugmode;
24
+    if ($debugmode) {
25
+        if (is_array($str)) {
26
+            array_walk_recursive($str, function (&$v) {
27
+                $v = htmlspecialchars($v);
28
+            });
29
+            echo "<pre>".print_r($str, true)."</pre>\n";
30
+        } elseif (is_object($str)) {
31
+            echo "<pre>".print_r($str, true)."</pre>\n";
32
+        } else {
33
+            echo htmlspecialchars($str) . "<br />\n";
34
+        }
32 35
     }
33 36
 }
34 37
 
35 38
 
36 39
 DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_r($_POST, true)));
37
-
38
-?>
Browse code

Verhindere XSS in Debug-ausgaben

Bernd Wurst authored on06/02/2018 13:25:36
Showing1 changed files
... ...
@@ -22,13 +22,13 @@ function DEBUG($str)
22 22
 {
23 23
   global $debugmode;
24 24
   if ($debugmode)
25
-    if (is_array($str) || is_object($str))
26
-    {
25
+    if (is_array($str)) {
26
+      array_walk_recursive($str, function(&$v) { $v = htmlspecialchars($v); });
27 27
       echo "<pre>".print_r($str, true)."</pre>\n";
28
-    }
29
-    else
30
-    {
31
-      echo $str . "<br />\n";
28
+    } elseif (is_object($str)) {
29
+      echo "<pre>".print_r($str, true)."</pre>\n";
30
+    } else {
31
+      echo htmlspecialchars($str) . "<br />\n";
32 32
     }
33 33
 }
34 34
 
Browse code

Copyright year update

Bernd Wurst authored on13/01/2018 06:07:05
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on08/02/2014 05:45:07
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on19/01/2013 10:49:50
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on11/03/2012 15:40:04
Showing1 changed files
... ...
@@ -1,4 +1,18 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 by schokokeks.org Hosting, namely
6
+  Bernd Wurst <bernd@schokokeks.org>
7
+  Hanno Böck <hanno@schokokeks.org>
8
+
9
+To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10
+
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12
+http://creativecommons.org/publicdomain/zero/1.0/
13
+
14
+Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15
+*/
2 16
 
3 17
 require_once('config.php');
4 18
 require_once('inc/base.php');
Browse code

Einige Dummheiten repariert, die beim ersetzen von $config durch config() aufgetreten sind. Zudem einige Closing-Tag-mismatches repariert, die man nur sieht wenn man XHTML-Modus einschaltet

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1377 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on23/05/2009 15:55:23
Showing1 changed files
... ...
@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 
3 3
 require_once('config.php');
4
+require_once('inc/base.php');
4 5
 $debugmode = (isset($_GET['debug']) && config('enable_debug'));
5 6
 
6 7
 function DEBUG($str)
Browse code

Mehr config-optionen und config via Wrapper-Funktion benutzen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1376 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on23/05/2009 15:24:52
Showing1 changed files
... ...
@@ -1,8 +1,7 @@
1 1
 <?php
2 2
 
3 3
 require_once('config.php');
4
-global $config;
5
-$debugmode = (isset($_GET['debug']) && $config['enable_debug']);
4
+$debugmode = (isset($_GET['debug']) && config('enable_debug'));
6 5
 
7 6
 function DEBUG($str)
8 7
 {
Browse code

some updates

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1134 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on13/08/2008 07:09:36
Showing1 changed files
... ...
@@ -6,15 +6,15 @@ $debugmode = (isset($_GET['debug']) && $config['enable_debug']);
6 6
 
7 7
 function DEBUG($str)
8 8
 {
9
-	global $debugmode;
10
-	if ($debugmode)
11
-    if (is_array($str))
9
+  global $debugmode;
10
+  if ($debugmode)
11
+    if (is_array($str) || is_object($str))
12 12
     {
13 13
       echo "<pre>".print_r($str, true)."</pre>\n";
14 14
     }
15 15
     else
16 16
     {
17
-	  	echo $str."<br />\n";
17
+      echo $str . "<br />\n";
18 18
     }
19 19
 }
20 20
 
Browse code

DEBUG-Ausgaben zentralisiert

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@562 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on28/07/2007 18:06:44
Showing1 changed files
... ...
@@ -4,7 +4,6 @@ require_once('config.php');
4 4
 global $config;
5 5
 $debugmode = (isset($_GET['debug']) && $config['enable_debug']);
6 6
 
7
-
8 7
 function DEBUG($str)
9 8
 {
10 9
 	global $debugmode;
... ...
@@ -19,4 +18,7 @@ function DEBUG($str)
19 18
     }
20 19
 }
21 20
 
21
+
22
+DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_r($_POST, true)));
23
+
22 24
 ?>
Browse code

Menü-Includes sinnvoller / Debug-Modus über config abschaltbar

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@526 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on01/07/2007 16:21:48
Showing1 changed files
... ...
@@ -1,14 +1,22 @@
1 1
 <?php
2 2
 
3
-$debugmode = false;
4
-if (isset($_GET['debug']))
5
-	$debugmode = true;
3
+require_once('config.php');
4
+global $config;
5
+$debugmode = (isset($_GET['debug']) && $config['enable_debug']);
6
+
6 7
 
7 8
 function DEBUG($str)
8 9
 {
9 10
 	global $debugmode;
10 11
 	if ($debugmode)
11
-		echo $str."<br />\n";
12
+    if (is_array($str))
13
+    {
14
+      echo "<pre>".print_r($str, true)."</pre>\n";
15
+    }
16
+    else
17
+    {
18
+	  	echo $str."<br />\n";
19
+    }
12 20
 }
13 21
 
14 22
 ?>
Browse code

webinterface => /webinterface

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@362 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on27/03/2007 07:40:51
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+$debugmode = false;
4
+if (isset($_GET['debug']))
5
+	$debugmode = true;
6
+
7
+function DEBUG($str)
8
+{
9
+	global $debugmode;
10
+	if ($debugmode)
11
+		echo $str."<br />\n";
12
+}
13
+
14
+?>