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

Dirk Haun dhaun at qs1489.pair.com
Sun Jun 22 04:24:16 EDT 2008


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

Modified Files:
	category.php 
Log Message:
Fixed SQL error when trying to change a category id to an already existing id (part of bug #0000659)


Index: category.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links/category.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** category.php	7 Jun 2008 12:41:45 -0000	1.17
--- category.php	22 Jun 2008 08:24:13 -0000	1.18
***************
*** 290,294 ****
  function links_save_category($cid, $old_cid, $pid, $category, $description, $tid, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon)
  {
!     global $_CONF, $_TABLES, $_USER, $LANG_LINKS, $LANG_LINKS_ADMIN, $_LI_CONF;
  
      // Convert array values to numeric permission values
--- 290,295 ----
  function links_save_category($cid, $old_cid, $pid, $category, $description, $tid, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon)
  {
!     global $_CONF, $_TABLES, $_USER, $LANG_LINKS, $LANG_LINKS_ADMIN, $_LI_CONF,
!            $PLG_links_MESSAGE17;
  
      // Convert array values to numeric permission values
***************
*** 302,305 ****
--- 303,318 ----
      }
  
+     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)) {
+                 return 17;
+             } else {
+                 return 11;
+             }
+         }
+     }
+ 
      // clean 'em up
      $description = addslashes (COM_checkHTML(COM_checkWords($description)));




More information about the geeklog-cvs mailing list