Project

General

Profile

« Previous | Next » 

Revision 520

Added by Matthias almost 17 years ago

Fixed #542 (thanks to Thorn)

View differences:

trunk/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.7.0 -------------------------------------
14
09-Jan-2008 Matthias Gallas
15
#	Fixed ticket #542 (Thanks to Thorn)
14 16
23-Dec-2007 Matthias Gallas
15 17
!	Changed all copyright notices to include now 2008
16 18
21-Sep-2007 Matthias Gallas
trunk/wb/framework/functions.php
879 879
function page_filename($string) {
880 880
	$string = entities_to_7bit(umlauts_to_entities($string));
881 881
	// Now replace spaces with page spcacer
882
	$string = str_replace(' ', PAGE_SPACER, $string);
882
	$string = trim($string);
883
	$string = preg_replace('/(\s)+/', PAGE_SPACER, $string);
883 884
	// Now remove all bad characters
884 885
	$bad = array(
885 886
	'\'', /* /  */ '"', /* " */	'<', /* < */	'>', /* > */
......
892 893
	$string = str_replace($bad, '', $string);
893 894
	// Now convert to lower-case
894 895
	$string = strtolower($string);
895
	// Now remove multiple page spacers
896
	$string = str_replace(PAGE_SPACER.PAGE_SPACER, PAGE_SPACER, $string);
897
	// Clean any page spacers at the end of string
898
	$string = str_replace(PAGE_SPACER, ' ', $string);
899
	$string = trim($string);
900
	$string = str_replace(' ', PAGE_SPACER, $string);
901 896
	// If there are any weird language characters, this will protect us against possible problems they could cause
902 897
	$string = str_replace(array('%2F', '%'), array('/', ''), urlencode($string));
903 898
	// Finally, return the cleaned string

Also available in: Unified diff