[geeklog-cvs] Geeklog-1.x/public_html/admin/plugins/links category.php, 1.18, 1.19

Dirk Haun dhaun at qs1489.pair.com
Sun Jun 22 04:55:05 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links
In directory qs1489.pair.com:/tmp/cvs-serv76328/public_html/admin/plugins/links

Modified Files:
	category.php 
Log Message:
Fixed new link category silently overwriting an existing category if they had the same id (part 2 of bug #0000659)


Index: category.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links/category.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** category.php	22 Jun 2008 08:24:13 -0000	1.18
--- category.php	22 Jun 2008 08:55:01 -0000	1.19
***************
*** 298,309 ****
      }
  
      // Check cid to make sure not illegal
!     if (($cid == $_LI_CONF['root']) || ($cid == 'user')) {
          return 11;
      }
  
!     if (!empty($old_cid) && !empty($cid) && ($cid != $old_cid)) {
!         // attempt to change the cid - check it doesn't exist yet
!         $ctrl = DB_getItem($_TABLES['linkcategories'], 'cid', "cid = '" . addslashes($cid) . "'");
          if (!empty($ctrl)) {
              if (isset($PLG_links_MESSAGE17)) {
--- 298,321 ----
      }
  
+     // clean 'em up
+     $description = addslashes(COM_checkHTML(COM_checkWords($description)));
+     $category    = addslashes(COM_checkHTML(COM_checkWords($category)));
+     $pid         = addslashes(strip_tags($pid));
+     $cid         = addslashes(strip_tags($cid));
+     $old_cid     = addslashes(strip_tags($old_cid));
+ 
+     if (empty($category) || empty($description)) {
+         return 7;
+     }
+ 
      // Check cid to make sure not illegal
!     if (($cid == addslashes($_LI_CONF['root'])) || ($cid == 'user')) {
          return 11;
      }
  
!     if (!empty($cid) && ($cid != $old_cid)) {
!         // this is either a new category or an attempt to change the cid
!         // - check that cid doesn't exist yet
!         $ctrl = DB_getItem($_TABLES['linkcategories'], 'cid', "cid = '$cid'");
          if (!empty($ctrl)) {
              if (isset($PLG_links_MESSAGE17)) {
***************
*** 315,329 ****
      }
  
-     // clean 'em up
-     $description = addslashes (COM_checkHTML(COM_checkWords($description)));
-     $category    = addslashes (COM_checkHTML(COM_checkWords($category)));
-     $pid     = addslashes(strip_tags($pid));
-     $cid     = addslashes(strip_tags($cid));
-     $old_cid = addslashes(strip_tags($old_cid));
- 
-     if (empty($category) || empty($description)) {
-         return 7;
-     }
- 
      // Check that they didn't delete the cid. If so, get the hidden one
      if (empty($cid) && !empty($old_cid)) {
--- 327,330 ----




More information about the geeklog-cvs mailing list