mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #977 from simonwelsh/rename-Transliterator
API Rename Transliterator to SS_Transliterator to remove conflict with Intl extension
This commit is contained in:
commit
3268c0dee8
@ -1517,7 +1517,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
*/
|
||||
function generateURLSegment($title){
|
||||
$t = (function_exists('mb_strtolower')) ? mb_strtolower($title) : strtolower($title);
|
||||
$t = Object::create('Transliterator')->toASCII($t);
|
||||
$t = Object::create('SS_Transliterator')->toASCII($t);
|
||||
$t = str_replace('&','-and-',$t);
|
||||
$t = str_replace('&','-and-',$t);
|
||||
$t = ereg_replace('[^A-Za-z0-9]+','-',$t);
|
||||
|
@ -6,14 +6,14 @@
|
||||
* Usage:
|
||||
*
|
||||
* <code>
|
||||
* $tr = new Transliterator();
|
||||
* $tr = new SS_Transliterator();
|
||||
* $ascii = $tr->toASCII($unicode);
|
||||
* </code>
|
||||
*
|
||||
* @package sapphire
|
||||
* @subpackage model
|
||||
*/
|
||||
class Transliterator {
|
||||
class SS_Transliterator {
|
||||
/**
|
||||
* Allow the use of iconv() to perform transliteration. Set to false to disable.
|
||||
* Even if this variable is true, iconv() won't be used if it's not installed.
|
||||
@ -58,4 +58,8 @@ class Transliterator {
|
||||
protected function useIconv($source) {
|
||||
return iconv("utf-8", "us-ascii//IGNORE//TRANSLIT", $source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!class_exists('Transliterator')) {
|
||||
class Transliterator extends SS_Transliterator {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user