[geeklog-cvs] geeklog: More missing finish() calls (cf. bug #0000855)

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Apr 18 15:10:53 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a9694bc60a1a
changeset: 6959:a9694bc60a1a
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Apr 18 21:10:04 2009 +0200
description:
More missing finish() calls (cf. bug #0000855)

diffstat:

5 files changed, 42 insertions(+), 19 deletions(-)
public_html/admin/plugins.php |    6 +++++-
public_html/admin/user.php    |   23 ++++++++++++++++++++---
public_html/docs/history      |    2 ++
public_html/lib-common.php    |   20 ++++++++++----------
system/lib-comment.php        |   10 +++++-----

diffs (159 lines):

diff -r 0774a19f037c -r a9694bc60a1a public_html/admin/plugins.php
--- a/public_html/admin/plugins.php	Sat Apr 18 19:46:23 2009 +0200
+++ b/public_html/admin/plugins.php	Sat Apr 18 21:10:04 2009 +0200
@@ -43,6 +43,10 @@
 * Geeklog common function library
 */
 require_once '../lib-common.php';
+
+/**
+* Security check to ensure user even belongs on this page
+*/
 require_once 'auth.inc.php';
 
 // Uncomment the line below if you need to debug the HTTP variables being passed
@@ -161,7 +165,7 @@
     $plg_templates->set_var('end_block',
             COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer')));
 
-    $retval .= $plg_templates->parse('output', 'editor');
+    $retval .= $plg_templates->finish($plg_templates->parse('output', 'editor'));
 
     return $retval;
 }
diff -r 0774a19f037c -r a9694bc60a1a public_html/admin/user.php
--- a/public_html/admin/user.php	Sat Apr 18 19:46:23 2009 +0200
+++ b/public_html/admin/user.php	Sat Apr 18 21:10:04 2009 +0200
@@ -33,10 +33,25 @@
 // +---------------------------------------------------------------------------+
 
 /**
+* User administration: Manage users (create, delete, import) and their
+* group membership.
+*
+*/
+
+/**
 * Geeklog common function library
 */
 require_once '../lib-common.php';
+
+/**
+* Security check to ensure user even belongs on this page
+*/
+
 require_once 'auth.inc.php';
+
+/**
+* User-related functions
+*/
 require_once $_CONF['path_system'] . 'lib-user.php';
 
 // Set this to true to get various debug messages from this script
@@ -819,7 +834,7 @@
     $user_templates->set_var('action_reminder', $LANG28[78]);
     $user_templates->parse('test', 'reminder');
 
-    $form_arr['top'] = $user_templates->get_var('test');
+    $form_arr['top'] = $user_templates->finish($user_templates->get_var('test'));
     $token = SEC_createToken();
     $form_arr['bottom'] = "<input type=\"hidden\" name=\"" . CSRF_TOKEN
                         . "\" value=\"{$token}\"" . XHTML . ">";
@@ -911,8 +926,8 @@
                 $template->set_var ('name', COM_getDisplayName ($uid));
                 $template->set_var ('lastlogin', $lasttime[0]);
 
-                $template->parse ('output', 'mail');
-                $mailtext = $template->get_var ('output');
+                $template->parse('output', 'mail');
+                $mailtext = $template->finish($template->get_var('output'));
             } else {
                 if ($lastlogin == 0) {
                     $mailtext = $LANG28[83] . "\n\n";
@@ -1094,6 +1109,8 @@
     global $_CONF, $LANG28, $LANG_ADMIN, $_IMAGE_TYPE;
 
     require_once $_CONF['path_system'] . 'lib-admin.php';
+
+    $retval = '';
 
     $token = SEC_createToken();
     $retval .= COM_siteHeader('menu', $LANG28[24]);
diff -r 0774a19f037c -r a9694bc60a1a public_html/docs/history
--- a/public_html/docs/history	Sat Apr 18 19:46:23 2009 +0200
+++ b/public_html/docs/history	Sat Apr 18 21:10:04 2009 +0200
@@ -11,6 +11,8 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Other changes:
+- Added missing finish() calls for some templates, e.g. header.thtml
+  (bug #0000855) [Dirk]
 - Moved documentation to docs/english so that it can be translated
   (feature request #0000770) [Dirk]
 - New plugin API function PLG_pluginStateChange [Dirk]
diff -r 0774a19f037c -r a9694bc60a1a public_html/lib-common.php
--- a/public_html/lib-common.php	Sat Apr 18 19:46:23 2009 +0200
+++ b/public_html/lib-common.php	Sat Apr 18 21:10:04 2009 +0200
@@ -2313,8 +2313,8 @@
         $usermenu->set_var( 'option_label', $LANG01[19] );
         $usermenu->set_var( 'option_count', '' );
         $usermenu->set_var( 'option_url', $url );
-        $retval .= $usermenu->parse( 'item', 'option' );
-        $retval .=  COM_endBlock( COM_getBlockTemplate( 'user_block', 'footer', $position ));
+        $retval .= $usermenu->finish($usermenu->parse('item', 'option'));
+        $retval .=  COM_endBlock(COM_getBlockTemplate('user_block', 'footer', $position));
     }
     else
     {
@@ -2387,8 +2387,8 @@
             $login->set_var('openid_login', '');
         }
 
-        $retval .= $login->parse( 'output', 'form' );
-        $retval .= COM_endBlock( COM_getBlockTemplate( 'user_block', 'footer', $position ));
+        $retval .= $login->finish($login->parse('output', 'form'));
+        $retval .= COM_endBlock( COM_getBlockTemplate('user_block', 'footer', $position));
     }
 
     return $retval;
@@ -2745,12 +2745,12 @@
         }
 
         $url = $_CONF['site_admin_url'] . '/moderation.php';
-        $adminmenu->set_var( 'option_url', $url );
-        $adminmenu->set_var( 'option_label', $LANG01[10] );
-        $adminmenu->set_var( 'option_count', COM_numberFormat( $modnum ));
-        $menu_item = $adminmenu->parse( 'item',
-                    ( $thisUrl == $url ) ? 'current' : 'option' );
-        $link_array = array( $menu_item ) + $link_array;
+        $adminmenu->set_var('option_url', $url);
+        $adminmenu->set_var('option_label', $LANG01[10]);
+        $adminmenu->set_var('option_count', COM_numberFormat($modnum));
+        $menu_item = $adminmenu->finish($adminmenu->parse('item',
+                        ($thisUrl == $url) ? 'current' : 'option'));
+        $link_array = array($menu_item) + $link_array;
 
         foreach( $link_array as $link )
         {
diff -r 0774a19f037c -r a9694bc60a1a system/lib-comment.php
--- a/system/lib-comment.php	Sat Apr 18 19:46:23 2009 +0200
+++ b/system/lib-comment.php	Sat Apr 18 21:10:04 2009 +0200
@@ -712,13 +712,13 @@
                                         $delete_option, false, $ccode );
 
         // Pagination
-        $tot_pages =  ceil( $count / $limit );
+        $tot_pages =  ceil($count / $limit);
         $pLink = $_CONF['site_url'] . "/article.php?story=$sid&type=$type&order=$order&mode=$mode";
-        $template->set_var( 'pagenav',
-                         COM_printPageNavigation($pLink, $page, $tot_pages));
+        $template->set_var('pagenav',
+                           COM_printPageNavigation($pLink, $page, $tot_pages));
 
-        $template->set_var( 'comments', $thecomments );
-        $retval = $template->parse( 'output', 'commentarea' );
+        $template->set_var('comments', $thecomments);
+        $retval = $template->finish($template->parse('output', 'commentarea'));
     }
 
     return $retval;



More information about the geeklog-cvs mailing list