| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @package Mambo Open Source |
* @version $Id: sef.php,v 1.3 2005/11/23 22:49:07 csouza Exp $ |
| 4 |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
* @package Mambo |
| 5 |
|
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
| 6 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
|
* |
|
|
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
|
|
* that Mambo remained free Open Source software owned and managed by the community. |
|
| 7 |
* Mambo is Free Software |
* Mambo is Free Software |
| 8 |
*/ |
*/ |
| 9 |
|
|
| 17 |
var $sef_content_task = array(); |
var $sef_content_task = array(); |
| 18 |
var $sef_name_chars = array(); |
var $sef_name_chars = array(); |
| 19 |
var $sef_translate_chars = array(); |
var $sef_translate_chars = array(); |
| 20 |
|
var $sef_name_string = ''; |
| 21 |
|
var $sef_translate_string = ''; |
| 22 |
var $content_data = null; |
var $content_data = null; |
| 23 |
var $content_items = array(); |
var $content_items = array(); |
| 24 |
var $content_sections = array(); |
var $content_sections = array(); |
| 81 |
** You can extend these arrays as you wish, although it is obviously important |
** You can extend these arrays as you wish, although it is obviously important |
| 82 |
** to make sure that the items of one match the items of the other exactly. |
** to make sure that the items of one match the items of the other exactly. |
| 83 |
*******************************************************************************/ |
*******************************************************************************/ |
| 84 |
$this->sef_name_chars = array('', '?', '&', '/', ' '); |
$this->sef_name_chars = array('?', '&', '/', ' '); |
| 85 |
$this->sef_translate_chars = array('-', '', 'and', ' or ', $this->SEF_SPACE); |
$this->sef_translate_chars = array('', 'and', ' or ', $this->SEF_SPACE); |
| 86 |
|
$this->sef_name_string = '\''; |
| 87 |
|
$this->sef_translate_string = '--'; |
| 88 |
|
|
| 89 |
/************** DO NOT MAKE CHANGES IN THE FOLLOWING LINES EXCEPT AT YOUR OWN RISK! ********************/ |
/************** DO NOT MAKE CHANGES IN THE FOLLOWING LINES EXCEPT AT YOUR OWN RISK! ********************/ |
| 90 |
|
|
| 126 |
return $instance; |
return $instance; |
| 127 |
} |
} |
| 128 |
|
|
| 129 |
|
function nameForURL ($string) { |
| 130 |
|
$accented = "¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ".$this->sef_name_string; |
| 131 |
|
$nonaccent = "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy".$this->sef_translate_string; |
| 132 |
|
$string = strtr($string, $accented, $nonaccent); |
| 133 |
|
foreach ($this->sef_name_chars as $i=>$char) $string = str_replace($char, $this->sef_translate_chars[$i], $string); |
| 134 |
|
$string = urlencode($string); |
| 135 |
|
return $string; |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
|
| 139 |
function sefRetrieval($register_globals){ |
function sefRetrieval($register_globals){ |
| 140 |
|
|
| 141 |
if (preg_match('/(\b)GLOBALS|_REQUEST|_SERVER|_ENV|_COOKIE|_GET|_POST|_FILES|_SESSION(\b)/i', $_SERVER['REQUEST_URI']) > 0) { |
if (preg_match('/(\b)GLOBALS|_REQUEST|_SERVER|_ENV|_COOKIE|_GET|_POST|_FILES|_SESSION(\b)/i', $_SERVER['REQUEST_URI']) > 0) { |