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 6126a307e..31a53cbde 100644
--- a/picture.php
+++ b/picture.php
@@ -52,7 +52,9 @@ SELECT id, file, level
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