diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-08 21:49:09 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-08 21:49:09 -0700 |
commit | 77bd3d3d40e3a51bce9f41f996222107fc8a7427 (patch) | |
tree | 8a9a08d6283e7bb0aebbd9a6695c2317fb058d57 /modules/gallery/helpers/item.php | |
parent | 0709f7526d58ea239a55cbe3edd82a56ba9b5eb9 (diff) |
Replace two preg_replace() calls with a single trim() call.
Diffstat (limited to 'modules/gallery/helpers/item.php')
-rw-r--r-- | modules/gallery/helpers/item.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index e015cb72..3d02d239 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -115,9 +115,7 @@ class item_Core { static function convert_filename_to_slug($filename) { $result = pathinfo($filename, PATHINFO_FILENAME); $result = preg_replace("/[^A-Za-z0-9-_]+/", "-", $result); - $result = preg_replace("/^-+/", "", $result); - $result = preg_replace("/-+$/", "", $result); - return $result; + return trim($result, "-"); } /** |