Permalink
Browse files

API Rename Transliterator to SS_Transliterator to remove conflict wit…

…h Intl extension
  • Loading branch information...
1 parent 326036a commit f49f1ff5df283b7324cbcd5840a8ea05ed727ce8 @simonwelsh simonwelsh committed Nov 28, 2012
Showing with 8 additions and 4 deletions.
  1. +1 −1 core/model/SiteTree.php
  2. +7 −3 core/model/Transliterator.php
View
2 core/model/SiteTree.php
@@ -1517,7 +1517,7 @@ public function validURLSegment() {
*/
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);
View
10 core/model/Transliterator.php
@@ -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 @@ protected function useStrTr($source) {
protected function useIconv($source) {
return iconv("utf-8", "us-ascii//IGNORE//TRANSLIT", $source);
}
-}
+}
+
+if(!class_exists('Transliterator')) {
+ class Transliterator extends SS_Transliterator {}
+}

0 comments on commit f49f1ff

Please sign in to comment.