[geeklog-cvs] geeklog: urlencode topic

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 7 06:42:31 EST 2010


changeset 7709:0033cdff4a24
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/0033cdff4a24
user: Dirk Haun <dirk at haun-online.de>
date: Sun Feb 07 10:54:20 2010 +0100
description:
urlencode topic

diffstat:

 public_html/lib-common.php |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (33 lines):

diff -r 1f143e240269 -r 0033cdff4a24 public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Feb 07 10:44:55 2010 +0100
+++ b/public_html/lib-common.php	Sun Feb 07 10:54:20 2010 +0100
@@ -627,21 +627,18 @@
         switch( $item )
         {
             case 'contribute':
-                if( empty( $topic ))
-                {
+                if (empty($topic)) {
                     $url = $_CONF['site_url'] . '/submit.php?type=story';
-                    $header->set_var( 'current_topic', '' );
-                }
-                else
-                {
+                    $header->set_var('current_topic', '');
+                } else {
+                    $tp = urlencode($topic);
                     $url = $_CONF['site_url']
-                         . '/submit.php?type=story&topic=' . $topic;
-                    $header->set_var( 'current_topic', '&topic=' . $topic );
+                         . '/submit.php?type=story&topic=' . $tp;
+                    $header->set_var('current_topic', '&topic=' . $tp);
                 }
                 $label = $LANG01[71];
-                if( $anon && ( $_CONF['loginrequired'] ||
-                        $_CONF['submitloginrequired'] ))
-                {
+                if ($anon && ($_CONF['loginrequired'] ||
+                              $_CONF['submitloginrequired'])) {
                     $allowed = false;
                 }
                 break;



More information about the geeklog-cvs mailing list