Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19175
Modified Files:
serendipity_config.inc.php serendipity_functions.inc.php
Log Message:
Fix %e date issue on windows systems. Replaced with %d, where you have a
leading zero. But windows users will surely live with that. ;-)
Fix serendipity_makefilename() to replace some more foreign characters (list
may be incomplete, the other characters are regexed out). Please test!
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.257
retrieving revision 1.258
diff -u -d -r1.257 -r1.258
--- serendipity_functions.inc.php 26 Apr 2004 10:33:20 -0000 1.257
+++ serendipity_functions.inc.php 3 May 2004 07:56:02 -0000 1.258
@@ -766,15 +766,80 @@
* Creates a filename that consists of [a-zA-z0-9_] (with some custom adjustments (space -> _, ä -> ae and such)
**/
function serendipity_makeFilename($str) {
- $str = str_replace('Ä', 'AE', $str);
- $str = str_replace('ä', 'ae', $str);
- $str = str_replace('Ö', 'OE', $str);
- $str = str_replace('ö', 'oe', $str);
- $str = str_replace('Ü', 'UE', $str);
- $str = str_replace('ü', 'ue', $str);
- $str = str_replace('ß', 'sz', $str);
- $str = str_replace(' ', '_' , $str);
- return preg_replace('#[^\w]#', '', $str);
+ static $from = array(
+ 'Ä',
+ 'ä',
+
+ 'Ö',
+ 'ö',
+
+ 'Ü',
+ 'ü',
+
+ 'ß',
+
+ 'é',
+ 'è',
+ 'ê',
+
+ 'í',
+ 'ì',
+ 'î',
+
+ 'á',
+ 'à',
+ 'â',
+
+ 'ó',
+ 'ò',
+ 'ô',
+
+ 'ú',
+ 'ù',
+ 'û',
+
+ 'ý',
+
+ ' ');
+
+ static $to = array(
+ 'AE',
+ 'ae',
+
+ 'OE',
+ 'oe',
+
+ 'UE',
+ 'ue',
+
+ 'ss',
+
+ 'e',
+ 'e',
+ 'e',
+
+ 'i',
+ 'i',
+ 'i',
+
+ 'a',
+ 'a',
+ 'a',
+
+ 'o',
+ 'o',
+ 'o',
+
+ 'u',
+ 'u',
+ 'u',
+
+ 'y',
+
+ '_');
+
+ $str = str_replace($from, $to, $str);
+ return preg_replace('#[^' . PAT_FILENAME . ']#i', '', $str);
}
/** Print a footer below the list of entries
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- serendipity_config.inc.php 27 Apr 2004 07:11:53 -0000 1.71
+++ serendipity_config.inc.php 3 May 2004 07:56:02 -0000 1.72
@@ -54,10 +54,11 @@
/* URI patterns
* Note that it's important to use @ as the pattern delimiter.
*/
+@define('PAT_FILENAME', '0-9a-z\.\_!%;,\+-');
@define('PAT_UNSUBSCRIBE', '@/'.PATH_UNSUBSCRIBE.'/(.*)/([0-9]+)@');
@define('PAT_ARCHIVES', '@/'.PATH_ARCHIVES.'/(\d+)\.html@');
@define('PAT_ARCHIVES_SHORT', '@/'.PATH_ARCHIVES.'/(\d+)_short\.html@');
-@define('PAT_COMMENTSUB', '@/(\d+)_[\w%]*\.html@i');
+@define('PAT_COMMENTSUB', '@/(\d+)_[' . PAT_FILENAME . ']*\.html@i');
@define('PAT_FEEDS', '@/'.PATH_FEEDS.'/@');
@define('PAT_FEED', '@/(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$@');
@define('PAT_ADMIN', '@/'.PATH_ADMIN.'$@');
|