Changeset 47

Show
Ignore:
Timestamp:
04/22/2006 08:27:17 AM (4 years ago)
Author:
DotMG
Message:

#142, #148, #145
URL containing .mm, Secured Link method
Refixing #131

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/formatters/wakka.php

    r4 r47  
    125125                { 
    126126                        $url = $matches[1]; 
    127                         if (preg_match("/^(.*)\.(gif|jpg|png)/si", $url)) { 
    128                                 return "<img src=\"$url\" alt=\"image\" />".$matches[2]; 
    129                         } else 
     127                        /* Inline images are disabled for security reason, use {{image action}} #142 
     128                        But if you still need this functionality, update this file like below 
     129                        if (preg_match("/\.(gif|jpg|png|svg)$/si", $url)) { 
     130                                return '<img src="'.$wakka->Link($url).'" alt="image" />'.$wakka->htmlspecialchars_ent($matches[2]); 
     131                        } else */ 
    130132                        // Mind Mapping Mod 
    131                         if (preg_match("/^(.*)\.(mm)/si", $url)) { 
     133                        if (preg_match("/\.(mm)$/si", $url)) { #145 
    132134                                return $wakka->Action("mindmap ".$url); 
    133135                        } else 
     
    191193                { 
    192194                        /* 
    193                          * Note: this routine is rewritten such that (new) language formatters 
    194                          * will automatically be found, whether they are GeSHi language config files 
    195                          * or "internal" Wikka formatters. 
    196                          * Path to GeSHi language files and Wikka formatters MUST be defined in config. 
    197                          * For line numbering (GeSHi only) a starting line can be specified after the language 
    198                          * code, separated by a ; e.g., %%(php;27)....%%. 
    199                          * Specifying >= 1 turns on line numbering if this is enabled in the configuration. 
    200                          */ 
     195                                * Note: this routine is rewritten such that (new) language formatters 
     196                                * will automatically be found, whether they are GeSHi language config files 
     197                                * or "internal" Wikka formatters. 
     198                                * Path to GeSHi language files and Wikka formatters MUST be defined in config. 
     199                                * For line numbering (GeSHi only) a starting line can be specified after the language 
     200                                * code, separated by a ; e.g., %%(php;27)....%%. 
     201                                * Specifying >= 1 turns on line numbering if this is enabled in the configuration. 
     202                                */ 
    201203                        $code = $matches[1]; 
    202204                        // if configuration path isn't set, make sure we'll get an invalid path so we 
  • trunk/wikka.php

    r46 r47  
    636636                // escape text? 
    637637                if ($escapeText) $text = $this->htmlspecialchars_ent($text); 
     638                $tag = $this->htmlspecialchars_ent($tag); #142 & #148 
     639                $method = $this->htmlspecialchars_ent($method); 
     640                $title = $this->htmlspecialchars_ent($title); 
    638641                $url = ''; 
    639642 
     
    11561159        exit; 
    11571160} 
    1158 #Fix lowercase mod_rewrite bug: Url rewritting lowercases the page name. 
     1161 
     1162// start session 
     1163session_start(); 
     1164 
     1165// fetch wakka location 
     1166$wakka = $_REQUEST["wakka"]; 
     1167 
     1168// remove leading slash 
     1169$wakka = preg_replace("/^\//", "", $wakka); 
     1170 
     1171// split into page/method 
     1172if (preg_match("#^(.+?)/(.*)$#", $wakka, $matches)) list(, $page, $method) = $matches; 
     1173else if (preg_match("#^(.*)$#", $wakka, $matches)) list(, $page) = $matches; 
     1174#Fix lowercase mod_rewrite bug: Url rewritting lowercases the page name. #135 
    11591175if (strtolower($page) == $page) 
    11601176{ 
     
    11651181 } 
    11661182} 
    1167  
    1168 // start session 
    1169 session_start(); 
    1170  
    1171 // fetch wakka location 
    1172 $wakka = $_REQUEST["wakka"]; 
    1173  
    1174 // remove leading slash 
    1175 $wakka = preg_replace("/^\//", "", $wakka); 
    1176  
    1177 // split into page/method 
    1178 if (preg_match("#^(.+?)/(.*)$#", $wakka, $matches)) list(, $page, $method) = $matches; 
    1179 else if (preg_match("#^(.*)$#", $wakka, $matches)) list(, $page) = $matches; 
    11801183 
    11811184// create wakka object