Project

General

Profile

« Previous | Next » 

Revision 547

Added by Matthias almost 17 years ago

Reintroduced changes from changeset [520] and [540] wich where overwritten by changeset [546]

Revoked changeset [541] end removed all PAGE_EXTENSION variables and the related option in WB settings as this function only works on Apache Servers together with .htaccess and mod_rewrite

Added keywords to file menu_link/uninstall.php

View differences:

functions.php
5 5
/*
6 6

  
7 7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2007, Ryan Djurovich
8
 Copyright (C) 2004-2008, Ryan Djurovich
9 9

  
10 10
 Website Baker is free software; you can redistribute it and/or modify
11 11
 it under the terms of the GNU General Public License as published by
......
881 881
function page_filename($string) {
882 882
	$string = entities_to_7bit(umlauts_to_entities($string));
883 883
	// Now replace spaces with page spcacer
884
	$string = str_replace(' ', PAGE_SPACER, $string);
884
	$string = trim($string);
885
	$string = preg_replace('/(\s)+/', PAGE_SPACER, $string);
885 886
	// Now remove all bad characters
886 887
	$bad = array(
887 888
	'\'', /* /  */ '"', /* " */	'<', /* < */	'>', /* > */
......
894 895
	$string = str_replace($bad, '', $string);
895 896
	// Now convert to lower-case
896 897
	$string = strtolower($string);
897
	// Now remove multiple page spacers
898
	$string = str_replace(PAGE_SPACER.PAGE_SPACER, PAGE_SPACER, $string);
899
	// Clean any page spacers at the end of string
900
	$string = str_replace(PAGE_SPACER, ' ', $string);
901
	$string = trim($string);
902
	$string = str_replace(' ', PAGE_SPACER, $string);
903 898
	// If there are any weird language characters, this will protect us against possible problems they could cause
904 899
	$string = str_replace(array('%2F', '%'), array('/', ''), urlencode($string));
905 900
	// Finally, return the cleaned string

Also available in: Unified diff