summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/item.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/item.php')
-rw-r--r--modules/gallery/helpers/item.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 8839861f..bf948731 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -121,6 +121,14 @@ class item_Core {
}
/**
+ * Convert a filename into something we can use as a url component.
+ * @param string $filename
+ */
+ static function convert_filename_to_slug($filename) {
+ return preg_replace("/[^A-Za-z0-9-_]+/", "-", pathinfo($filename, PATHINFO_FILENAME));
+ }
+
+ /**
* Display delete confirmation message and form
* @param object $item
* @return string form