aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/picture.php b/picture.php
index 29e2fc69a..1661c7305 100644
--- a/picture.php
+++ b/picture.php
@@ -56,7 +56,9 @@ SELECT id, file
else
{// url given by file name
assert( !empty($page['image_file']) );
- $query .= 'file LIKE "' . $page['image_file'] . '.%" ESCAPE "|" LIMIT 1';
+ $query .= 'file LIKE "' .
+ str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ).
+ '.%" ESCAPE "/" LIMIT 1';
}
if ( ! ( $row = mysql_fetch_array(pwg_query($query)) ) )
{// element does not exist