[geeklog-hg] geeklog: Make topics case insensitive for directory and other areas

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Wed Sep 18 21:36:03 EDT 2013


changeset 9305:1f05c38a1958
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/1f05c38a1958
user: Tom <websitemaster at cogeco.net>
date: Wed Sep 18 21:30:30 2013 -0400
description:
Make topics case insensitive for directory and other areas

diffstat:

 public_html/directory.php  |  6 +++++-
 public_html/index.php      |  2 +-
 public_html/lib-common.php |  7 +++++--
 system/lib-topic.php       |  2 +-
 4 files changed, 12 insertions(+), 5 deletions(-)

diffs (60 lines):

diff -r 004a0e8a3216 -r 1f05c38a1958 public_html/directory.php
--- a/public_html/directory.php	Wed Sep 18 20:57:58 2013 -0400
+++ b/public_html/directory.php	Wed Sep 18 21:30:30 2013 -0400
@@ -543,9 +543,13 @@
 }
 // See if user has access to view topic.
 if ($topic != '') {
-    if ($topic != DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND'))) {
+    $test_topic = DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND'));
+    if (strtolower($topic) != strtolower($test_topic)) {
         $topic = '';
         $dir_topic = 'all';
+    } else {
+        $topic = $test_topic;
+        $dir_topic = $test_topic;
     }
 }
 
diff -r 004a0e8a3216 -r 1f05c38a1958 public_html/index.php
--- a/public_html/index.php	Wed Sep 18 20:57:58 2013 -0400
+++ b/public_html/index.php	Wed Sep 18 21:30:30 2013 -0400
@@ -262,7 +262,7 @@
     $sql .= " AND frontpage = 1 AND ta.tdefault = 1";
 }
 
-if ($topic != $archivetid) {
+if (strtolower($topic) != strtolower($archivetid)) {
     $sql .= " AND ta.tid != '{$archivetid}' ";
 }
 
diff -r 004a0e8a3216 -r 1f05c38a1958 public_html/lib-common.php
--- a/public_html/lib-common.php	Wed Sep 18 20:57:58 2013 -0400
+++ b/public_html/lib-common.php	Wed Sep 18 21:30:30 2013 -0400
@@ -274,9 +274,12 @@
 }
 // See if user has access to view topic
 if ($topic != '') {
-    if ($topic != DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND'))) {
+    $test_topic = DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND'));
+    if (strtolower($topic) != strtolower($test_topic)) {
         $topic = '';
-    }
+    } else { // Make it equal to the db version since case maybe different
+        $topic = $test_topic;
+    }    
 }
 
 /**
diff -r 004a0e8a3216 -r 1f05c38a1958 system/lib-topic.php
--- a/system/lib-topic.php	Wed Sep 18 20:57:58 2013 -0400
+++ b/system/lib-topic.php	Wed Sep 18 21:30:30 2013 -0400
@@ -1192,7 +1192,7 @@
     }
     // See if user has access to view topic
     if ($topic != '') {
-        if ($topic != DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND'))) {
+        if (strtolower($topic) != strtolower(DB_getItem($_TABLES['topics'], 'tid', "tid = '$topic' " . COM_getPermSQL('AND')))) {
             $topic = '';
         }
     }



More information about the geeklog-cvs mailing list