diff --git a/libraries/Routes.php b/libraries/Routes.php index 861b707..ebae86a 100644 --- a/libraries/Routes.php +++ b/libraries/Routes.php @@ -42,7 +42,7 @@ function get_route($path_info) { case 0: - $controller='modules/'.\PhangoApp\PhaRouter\Config::$home_module.'/controllers/index.php'; + $controller='modules/'.\PhangoApp\PhaRouter\Config::$home_module.'/controllers/app.php'; return \PhangoApp\PhaRouter\get_controller($controller, []); @@ -50,7 +50,7 @@ function get_route($path_info) { case 1: - $controller='modules/'.$arr_path[1].'/controllers/index.php'; + $controller='modules/'.$arr_path[1].'/controllers/app.php'; if(in_array($arr_path[1], Config::$modules_allowed)) { diff --git a/libraries/Utils.php b/libraries/Utils.php index b73157d..9fa1b61 100644 --- a/libraries/Utils.php +++ b/libraries/Utils.php @@ -51,7 +51,7 @@ class Utils { $text=preg_replace('~[^-\w]+~', '', $text); return $text;*/ - + /* $from='àáâãäåæçèéêëìíîïðòóôõöøùúûýþÿŕñÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÒÓÔÕÖØÙÚÛÝỲŸÞŔÑ¿?!¡()"|#*%,;+&$ºª<>`çÇ{}@~=^:´[]'; $to= 'aaaaaaaceeeeiiiidoooooouuuybyrnAAAAAACEEEEIIIIDOOOOOOUUUYYYBRN---------------------------------'; @@ -88,9 +88,55 @@ class Utils { $text=trim(preg_replace('~'.$replace_space.'+~', $replace_space, $text), '-'); - $text=preg_replace('~[^-\w]+~', '', $text); + if($replace_dot==1) + { + + $text=preg_replace('~[^-\w]+~', '', $text); + + } + + return utf8_encode($text); */ + + $from=iconv('utf-8', 'us-ascii//TRANSLIT', '¿?{}@~=^:´[]#*·'); + $to= iconv('utf-8', 'us-ascii//TRANSLIT', '---------------'); + + if($replace_dot==1) + { + + $from.='.'; + $to.='-'; + + } + + if($replace_barr==1) + { + + $from.="/"; + $to.="-"; + + } + + //utf8_decode(urldecode($text)); + + $text=trim(str_replace(" ", $replace_space, $text)); + + $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); + + $text=preg_replace('~[^-\w]+~', '', $text); + + //$text = strtr($text, $from, $to); + + //Used for pass base64 via GET that use upper, for example. + + if($respect_upper==0) + { + + $text = strtolower($text); + + } + + return $text; //iconv('us-ascii//TRANSLIT', 'utf-8', $text); - return utf8_encode($text); } diff --git a/modules/welcome/controllers/index.php b/modules/welcome/controllers/app.php similarity index 100% rename from modules/welcome/controllers/index.php rename to modules/welcome/controllers/app.php