From 526859d9605d137ebe053ecbd80f46ca6a331194 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Apr 2011 13:56:32 -0700 Subject: Do simple transliteration when converting filenames to slugs, but check to see if the transliteration module is available and use a more complex transliteration if possible. Fixes #1668. --- modules/gallery/models/item.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/gallery/models') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 8f4bc5e4..f46db696 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -336,9 +336,7 @@ class Item_Model_Core extends ORM_MPTT { // Make an url friendly slug from the name, if necessary if (empty($this->slug)) { - $tmp = pathinfo($this->name, PATHINFO_FILENAME); - $tmp = preg_replace("/[^A-Za-z0-9-_]+/", "-", $tmp); - $this->slug = trim($tmp, "-"); + $this->slug = item::convert_filename_to_slug($this->name); // If the filename is all invalid characters, then the slug may be empty here. Pick a // random value. -- cgit v1.2.3