Changeset 1046 for trunk


Ignore:
Timestamp:
Feb 17, 2006, 3:41:57 AM (18 years ago)
Author:
rvelices
Message:

fix: remote site decodes html entities from xml and addslashes

fix: picture displays "image rank/total" images even for non numeric categories

fix: category comment not transformed with nl2br if allow_html_descriptions and
comment already looks like html

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/site_reader_remote.php

    r1029 r1046  
    153153    if (getAttribute($xml_element, $att) != '')
    154154    {
    155       $data[$att] = getAttribute($xml_element, $att);
     155      $val = html_entity_decode( getAttribute($xml_element, $att) );
     156      $data[$att] = addslashes($val);
    156157    }
    157158  }
  • trunk/include/functions_category.inc.php

    r1042 r1046  
    161161    }
    162162  }
    163   $cat['comment'] = nl2br($cat['comment']);
     163  global $conf;
     164  if ( !( $conf['allow_html_descriptions'] and
     165          preg_match('/<(div|br|img).*>/i', $cat['comment']) ) )
     166  {
     167    $cat['comment'] = nl2br($cat['comment']);
     168  }
    164169
    165170  $names = array();
  • trunk/picture.php

    r1042 r1046  
    530530
    531531$title_img = $picture['current']['name'];
    532 $title_nb = '';
    533532if (is_numeric( $page['cat'] ))
    534533{
    535534  $title_img = replace_space(get_cat_display_name($page['cat_name']));
    536   $n = $page['current_rank'] + 1;
    537   $title_nb = $n.'/'.$page['cat_nb_images'];
    538535}
    539536else if ( $page['cat'] == 'search' )
     
    541538  $title_img = replace_search( $title_img, $_GET['search'] );
    542539}
     540$title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images'];
    543541
    544542// calculation of width and height
  • trunk/tools/create_listing_file.php

    r1029 r1046  
    461461            foreach (array_keys($iptc) as $key)
    462462            {
    463               $element[$key] = addslashes($iptc[$key]);
     463              $element[$key] = $iptc[$key];
    464464            }
    465465          }
     
    541541    $listing = '<informations';
    542542    $listing.= ' generation_date="'.date('Y-m-d').'"';
    543     $listing.= ' phpwg_version="'.$conf{'version'}.'"';
     543    $listing.= ' phpwg_version="'.htmlentities($conf{'version'}).'"';
    544544   
    545545    $attrs=array();
Note: See TracChangeset for help on using the changeset viewer.