Просмотр исходного кода

Expose the display transforms separately

Zachary Kotlarek 13 лет назад
Родитель
Сommit
9a287d804c
1 измененных файлов с 11 добавлено и 6 удалено
  1. 11 6
      web/includes/util.php

+ 11 - 6
web/includes/util.php

@@ -41,12 +41,17 @@ function isJunk($path) {
 	return false;
 }
 
-function sortTitle($name) {
-	$name = preg_replace('/^The\s+/i', '', $name);
-	$name = preg_replace('/^A\s+/i', '', $name);
-	$name = preg_replace('/\xEF\x80\xA9$/', '.', $name);
-	$name = preg_replace('/\xEF\x80\xA5/', '?', $name);
-	return $name;
+function sortTitle($title) {
+	$title = displayTitle($title);
+	$title = preg_replace('/^The\s+/i', '', $title);
+	$title = preg_replace('/^A\s+/i', '', $title);
+	return $title;
+}
+
+function displayTitle($title) {
+	$title = preg_replace('/\xEF\x80\xA9$/', '.', $title);
+	$title = preg_replace('/\xEF\x80\xA5/', '?', $title);
+	return $title;
 }
 
 ?>