Changeset 1644

Show
Ignore:
Timestamp:
12/28/06 14:13:19 (22 months ago)
Author:
mbonetti
Message:

Experimental: UTF-8 category names

Location:
trunk/gregarius
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/admin/channels.php

    r1629 r1644  
    547547                        list($retcde, $retmsg) = add_channel($u__, $fid, $t__, $d__); 
    548548                        if ($retcde && count($c__)) { 
    549                             __exp__submitTag($retcde,$c__,"'channel'"); 
     549                            __exp__submitTag($retcde,utf_encode($c__),"'channel'"); 
    550550                        } 
    551551                        echo ($retcde<0 ?$retmsg:" OK")."</p></li>\n"; 
     
    642642 
    643643        rss_query($sql); 
    644         __exp__submitTag($cid,$tags,"'channel'"); 
     644        __exp__submitTag($cid,utf8_decode($tags),"'channel'"); 
    645645        rss_invalidate_cache(); 
    646646        $ret__ = CST_ADMIN_DOMAIN_CHANNEL; 
  • trunk/gregarius/cls/categories.php

    r1561 r1644  
    3535        $this->id = $id; 
    3636        if (getConfig('rss.output.usemodrewrite')) { 
    37             $this->rlink = getPath().preg_replace("/[^a-zA-Z0-9_]/", "_", $name)."/"; 
     37            $this->rlink = $this -> makeFolderUrl($name); //.preg_replace("/[^a-zA-Z0-9_]/", "_", $name)."/"; 
    3838        } else { 
    3939            $this->rlink = getPath()."feed.php?vfolder=$id"; 
  • trunk/gregarius/cls/channels.php

    r1561 r1644  
    130130        $this->id = $id; 
    131131        if (getConfig('rss.output.usemodrewrite')) { 
    132             $this->rlink = getPath().preg_replace("/[^a-zA-Z0-9_]/", "_", $name)."/"; 
     132            $this->rlink = $this -> makeFolderUrl($name); // getPath().preg_replace("/[^a-zA-Z0-9_]/", "_", $name)."/"; 
    133133        } else { 
    134134            $this->rlink = getPath()."feed.php?folder=$id"; 
     
    136136        $this->isRootFolder = ($id == 0); 
    137137        $this->rootList = $rootList; 
     138    } 
     139     
     140    function makeFolderUrl($fn) { 
     141        return getPath( 
     142            preg_replace('#\s#','_',sanitize($fn,RSS_SANITIZER_URL)) 
     143        ) .'/'; 
    138144    } 
    139145     
  • trunk/gregarius/util.php

    r1641 r1644  
    965965// moved from ajax.php 
    966966function __exp__submitTag($id,$tags,$type = "'item'") { 
     967    $tags = strip_tags($tags); 
    967968    $ftags = utf8_encode( preg_replace(ALLOWED_TAGS_REGEXP,'', trim($tags))); 
    968969    $tarr = array_slice(explode(" ",$ftags),0,MAX_TAGS_PER_ITEM); 
     
    980981            continue; 
    981982        } 
     983        $ttag = sanitize($ttag, 
     984            RSS_SANITIZER_NO_SPACES | RSS_SANITIZER_SIMPLE_SQL 
     985        ); 
     986         
    982987        rss_query( "insert into ". getTable('tag') 
    983988                   . " (tag) values ('$ttag')", false );