Changeset 1653

Show
Ignore:
Timestamp:
01/02/07 22:57:46 (20 months ago)
Author:
mbonetti
Message:

fix for #255. See RSS_URI_SEPARATOR in constants.php

Location:
trunk/gregarius
Files:
4 modified

Legend:

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

    r1648 r1653  
    8888 
    8989        if (getConfig('rss.output.usemodrewrite')) { 
    90             //$this->rlink = getPath().preg_replace("/[^a-zA-Z0-9_]/", "_", $title)."/"; 
    91             /* EXPERIMENTAL! */ 
    9290            $this->rlink = getPath(rss_uri($title)) . "/"; 
    9391        } else { 
  • trunk/gregarius/constants.php

    r1525 r1653  
    175175define ('RSS_SANITIZER_URL',0x40); 
    176176 
     177 
     178// Character separating uri elements (for e.g. permalinks) 
     179define('RSS_URI_SEPARATOR','_'); 
     180 
     181 
    177182// Profiling  
    178183//  - The profiling information is "html commented out" at the end of every html page 
  • trunk/gregarius/feed.php

    r1649 r1653  
    6060    && !is_numeric($_REQUEST['channel']) 
    6161) { 
    62     $sqlid = sanitize($_REQUEST['channel'], RSS_SANITIZER_SIMPLE_SQL | RSS_SANITIZER_NO_SPACES); 
     62    $sqlid = preg_replace('#'.RSS_URI_SEPARATOR.'#','_', 
     63        sanitize($_REQUEST['channel'] , RSS_SANITIZER_SIMPLE_SQL ) 
     64        ); 
    6365 
    6466    $sql = "select id from " . getTable("channels") ." where title like '$sqlid'"; 
     
    7072    // $sql .= " and not(mode & " . RSS_MODE_DELETED_STATE . ") "; 
    7173 
     74//  die($sql); 
    7275    $res =  rss_query( $sql ); 
    7376    //echo $sql; 
  • trunk/gregarius/util.php

    r1649 r1653  
    11561156} 
    11571157 
    1158 function rss_uri($title, $sep='_') { 
    1159     return utf8_uri_encode(preg_replace('#[ \#%\s&/\+\'"\?]#',$sep,$title)); 
     1158function rss_uri($title, $sep=RSS_URI_SEPARATOR) { 
     1159    return utf8_uri_encode(preg_replace('#[ \#%&/\+\'"\?]#',$sep,$title)); 
    11601160} 
    11611161?>