[Fusionforge-commits] r9714 - trunk/gforge/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon May 10 17:02:45 CEST 2010


Author: lolando
Date: 2010-05-10 17:02:45 +0200 (Mon, 10 May 2010)
New Revision: 9714

Modified:
   trunk/gforge/common/include/minijson.php
   trunk/gforge/common/include/utils.php
Log:
document there is no float in minijson; avoid php warning in utils


Modified: trunk/gforge/common/include/minijson.php
===================================================================
--- trunk/gforge/common/include/minijson.php	2010-05-10 15:02:30 UTC (rev 9713)
+++ trunk/gforge/common/include/minijson.php	2010-05-10 15:02:45 UTC (rev 9714)
@@ -25,6 +25,12 @@
  * use (and, if necessary, extend) this module.
  */
 
+/*-
+ * I was really, really bad at writing parsers. I still am really bad at
+ * writing parsers.
+ * -- Rasmus Lerdorf
+ */
+
 /**
  * Encodes an array (indexed or associative) as JSON.
  *
@@ -46,6 +52,7 @@
 			return $z;
 		$x = (string)$x;
 	}
+	/* note: no float here (for now); be locales-aware! */
 	if (is_string($x)) {
 		$rs = "\"";
 		foreach (str_split($x) as $v) {

Modified: trunk/gforge/common/include/utils.php
===================================================================
--- trunk/gforge/common/include/utils.php	2010-05-10 15:02:30 UTC (rev 9713)
+++ trunk/gforge/common/include/utils.php	2010-05-10 15:02:45 UTC (rev 9714)
@@ -1184,6 +1184,9 @@
 
 /* returns an integer from http://forge/foo/bar.php/123 or false */
 function util_path_info_last_numeric_component() {
+	if (!isset($_SERVER['PATH_INFO']))
+		return false;
+
 	/* PHP devs are idiots… ereg_replace is deprecated WTF? */
 	$ok = false;
 	foreach (str_split($_SERVER['PATH_INFO']) as $x) {




More information about the Fusionforge-commits mailing list