[Fusionforge-commits] r10277 - trunk/src/plugins/blocks/www

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Jul 20 19:07:55 CEST 2010


Author: lolando
Date: 2010-07-20 19:07:54 +0200 (Tue, 20 Jul 2010)
New Revision: 10277

Modified:
   trunk/src/plugins/blocks/www/index.php
Log:
Only try to json_decode() if that function exists

Modified: trunk/src/plugins/blocks/www/index.php
===================================================================
--- trunk/src/plugins/blocks/www/index.php	2010-07-20 16:42:20 UTC (rev 10276)
+++ trunk/src/plugins/blocks/www/index.php	2010-07-20 17:07:54 UTC (rev 10277)
@@ -328,8 +328,8 @@
 		print "<input type=\"hidden\" name=\"name\" value=\"$name\" />\n";
 
 		// Get default page from the templates defined in the config file.
-		$templates=json_decode(file_get_contents(forge_get_config('templates_file','blocks'))) ;
-		if (!$body) {
+		if (!$body && function_exists ('json_decode')) {
+			$templates=json_decode(file_get_contents(forge_get_config('templates_file','blocks'))) ;
 			if (isset($templates[$name])) {
 				$body = $templates[$name];
 			} else {




More information about the Fusionforge-commits mailing list