Parcourir la source

Expose the display transforms separately

Zachary Kotlarek il y a 13 ans
Parent
commit
9a287d804c
1 fichiers modifiés avec 11 ajouts et 6 suppressions
  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;
 }
 
 ?>