Version 4.1.19.4
This commit is contained in:
1 parent
2bd5025018
commit
0dc2aee5ed
312 files changed
+53730
-32118
No files matched your search
@@ -391,7 +391,7 @@ class _Friendly extends \IPS\Http\Url\Internal
|
||||
|
||||
/* Disallowed characters which browsers may try to automatically percent-encode */
|
||||
$value = str_replace( array( '!', '*', '\'', '(', ')', ';', ':', '@', '&', '=', '+', '$', ',', '/', '?', '#', '[', ']', '%', '\\', '"', '<', '>', '^', '{', '}', '|', '.', '`' ), '', $value );
|
||||
if(defined("\IPS\IPB_USE_SEO_TRANSLIT")&&\IPS\IPB_USE_SEO_TRANSLIT) $value = self::rus2translit($value);
|
||||
|
||||
/* Trim */
|
||||
$value = preg_replace( '/\-+/', '-', $value );
|
||||
$value = trim( $value, '-' );
|
||||
@@ -400,62 +400,6 @@ class _Friendly extends \IPS\Http\Url\Internal
|
||||
/* Return */
|
||||
return $value ?: '-';
|
||||
}
|
||||
|
||||
static function rus2translit($string) {
|
||||
|
||||
$converter = array(
|
||||
|
||||
'а' => 'a', 'б' => 'b', 'в' => 'v',
|
||||
|
||||
'г' => 'g', 'д' => 'd', 'е' => 'e',
|
||||
|
||||
'ё' => 'e', 'ж' => 'zh', 'з' => 'z',
|
||||
|
||||
'и' => 'i', 'й' => 'y', 'к' => 'k',
|
||||
|
||||
'л' => 'l', 'м' => 'm', 'н' => 'n',
|
||||
|
||||
'о' => 'o', 'п' => 'p', 'р' => 'r',
|
||||
|
||||
'с' => 's', 'т' => 't', 'у' => 'u',
|
||||
|
||||
'ф' => 'f', 'х' => 'h', 'ц' => 'c',
|
||||
|
||||
'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch',
|
||||
|
||||
'ь' => '', 'ы' => 'y', 'ъ' => '',
|
||||
|
||||
'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
|
||||
|
||||
|
||||
|
||||
'А' => 'A', 'Б' => 'B', 'В' => 'V',
|
||||
|
||||
'Г' => 'G', 'Д' => 'D', 'Е' => 'E',
|
||||
|
||||
'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z',
|
||||
|
||||
'И' => 'I', 'Й' => 'Y', 'К' => 'K',
|
||||
|
||||
'Л' => 'L', 'М' => 'M', 'Н' => 'N',
|
||||
|
||||
'О' => 'O', 'П' => 'P', 'Р' => 'R',
|
||||
|
||||
'С' => 'S', 'Т' => 'T', 'У' => 'U',
|
||||
|
||||
'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C',
|
||||
|
||||
'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sch',
|
||||
|
||||
'Ь' => '', 'Ы' => 'Y', 'Ъ' => '',
|
||||
|
||||
'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya',
|
||||
|
||||
);
|
||||
|
||||
return strtr($string, $converter);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the matched parameters and SEO titles from a friendly URL component for a particular
|
||||
|
||||
Reference in new issue
Block a user