[geeklog-cvs] Geeklog-1.x/plugins/links functions.inc,1.99,1.100

Dirk Haun dhaun at qs1489.pair.com
Tue Jan 1 11:01:41 EST 2008


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

Modified Files:
	functions.inc 
Log Message:
Encode special characters in dropdowns; removed unused function


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/links/functions.inc,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
*** functions.inc	1 Jan 2008 14:10:45 -0000	1.99
--- functions.inc	1 Jan 2008 16:01:39 -0000	1.100
***************
*** 1271,1313 ****
  
  
! /**
! * Return a list of all link categories
! *
! * @param    ref     $current_category   currently selected category
! * @return   string                      <option> list containing all categories
! *
! * Note: $current_category will be returned as an empty string when found in the
! *       current list of categories and left untouched when it's a new category,
! *       i.e. the user selected "Other". This is needed for moderating link
! *       submissions.
! *
! */
! function links_getCategoryList (&$current_category)
  {
-     global $_TABLES, $LANG_LINKS_ADMIN;
- 
-     $retval = '';
- 
-     $result = DB_query("SELECT DISTINCT category FROM {$_TABLES['links']}" . COM_getPermSQL () . " GROUP BY category");
-     $nrows = DB_numRows($result);
- 
-     $retval = '<option value="' . $LANG_LINKS_ADMIN[7] . '">'
-             . $LANG_LINKS_ADMIN[7] . '</option>';
-     for ($i = 0; $i < $nrows; $i++) {
-         $A = DB_fetchArray ($result);
-         $category = $A['category'];
-         $retval .= '<option value="' . $category . '"';
-         if ($category == $current_category) {
-             $retval .= ' selected="selected"';
-             $current_category = '';
-         }
-         $retval .= '>' . $category . '</option>';
-     }
- 
-     return $retval;
- }
- 
- function links_validateUrl($url) {
      global $LANG_LINKS_STATUS;
      $header_str = '';
      $url_arr = parse_url($url);
--- 1271,1278 ----
  
  
! function links_validateUrl($url)
  {
      global $LANG_LINKS_STATUS;
+ 
      $header_str = '';
      $url_arr = parse_url($url);
***************
*** 1430,1439 ****
          if ($cid == $sel) {
              // yes, selected
!             $menu .= '<option value="' . $cid . '" selected="selected">'
!                   . $indent . $category . '</option>';
          } else {
              // no, not selected
!             $menu .= '<option value="' . $cid. '">' . $indent . $category
!                   . '</option>';
          }
          // Check and see if this category has any sub categories
--- 1395,1405 ----
          if ($cid == $sel) {
              // yes, selected
!             $menu .= '<option value="' . htmlspecialchars($cid)
!                   . '" selected="selected">' . $indent . $category
!                   . '</option>';
          } else {
              // no, not selected
!             $menu .= '<option value="' . htmlspecialchars($cid) . '">'
!                   . $indent . $category . '</option>';
          }
          // Check and see if this category has any sub categories




More information about the geeklog-cvs mailing list