[geeklog-hg] geeklog: Fixed stripslashes and staticpage content only rendered...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jul 16 14:13:00 EDT 2013


changeset 9202:1b8939c24d70
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/1b8939c24d70
user: Tom <websitemaster at cogeco.net>
date: Tue Jul 16 14:10:08 2013 -0400
description:
Fixed stripslashes and staticpage content only rendered once now not twice when using a staticpage as a template.

diffstat:

 plugins/staticpages/functions.inc    |  17 ++++++++---------
 plugins/staticpages/services.inc.php |   7 ++++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (59 lines):

diff -r 102d378d9987 -r 1b8939c24d70 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Tue Jul 16 14:06:47 2013 -0400
+++ b/plugins/staticpages/functions.inc	Tue Jul 16 14:10:08 2013 -0400
@@ -1746,30 +1746,29 @@
         
         // Check for type (ie html or php)
         if ($sp_php == 1) {
-            $retval = eval($sp_content);
+            $sp_content = eval($sp_content);
         } elseif ($sp_php == 2) {
             ob_start();
             eval($sp_content);
-            $retval = ob_get_contents();
+            $sp_content = ob_get_contents();
             ob_end_clean();
-        } else {
-            $retval = $sp_content;
         }
-        $retval = PLG_replaceTags($retval);
+        
+        $sp_content = PLG_replaceTags($sp_content);
     } else {
         if ($sp_php != 0) {
             COM_errorLog("PHP in static pages is disabled. Can not display page.", 1);
-            $retval .= $LANG_STATIC['deny_msg'];
+            $sp_content .= $LANG_STATIC['deny_msg'];
         } else {
-            $retval .= PLG_replaceTags($sp_content);
+            $sp_content .= PLG_replaceTags($sp_content);
         }
     }
     
     $sp_content = stripslashes($sp_content);
 
-    if ($cache_time > 0 AND $sp_php == 0) { CACHE_create_instance($cacheInstance, $retval, 0); }
+    if ($cache_time > 0 AND $sp_php == 0) { CACHE_create_instance($cacheInstance, $sp_content, 0); }
     
-    return $retval;
+    return $sp_content;
 }
 
 /**
diff -r 102d378d9987 -r 1b8939c24d70 plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php	Tue Jul 16 14:06:47 2013 -0400
+++ b/plugins/staticpages/services.inc.php	Tue Jul 16 14:10:08 2013 -0400
@@ -755,9 +755,10 @@
             $output = DB_fetchArray($result, false);
 
             // WE ASSUME $output doesn't have any confidential fields
-            
-            // Generate output now
-            $output['sp_content'] = SP_render_content($page, $output['sp_content'], $output['sp_php'], $output['cache_time'], $output['template_id']);
+            // Generate output now (omly if not grabing a template since template is combined with variables first and then generated)
+            if (!isset($args['template'])) {
+                $output['sp_content'] = SP_render_content($page, $output['sp_content'], $output['sp_php'], $output['cache_time'], $output['template_id']);
+            }
         } else { // an error occured (page not found, access denied, ...)
 
             /**



More information about the geeklog-cvs mailing list