aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-10-13 00:31:29 +0000
committerrvelices <rv-github@modusoptimus.com>2006-10-13 00:31:29 +0000
commit60866f64c883091a7264299e3094c2ce733bfe91 (patch)
tree6b5db8e2a7d28e591a3e2590018c6b5de838d5af
parentec6f50bbfb505894529facef2f8c86c7336c7b63 (diff)
bug 560: url issue when $conf['picture_url_style']='file' and filename is
numeric or numeric followed by - git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1561 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_url.inc.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 7d30577fa..22c91d1e6 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -213,16 +213,15 @@ function make_picture_url($params)
}
break;
case 'file':
- if ( isset($params['image_file'])
- and !is_numeric($params['image_file']) )
- {
- $url .= get_filename_wo_extension($params['image_file']);
- }
- else
+ if ( isset($params['image_file']) )
{
- $url .= $params['image_id'];
+ $fname_wo_ext = get_filename_wo_extension($params['image_file']);
+ if (! preg_match('/^\d+(-|$)/', $fname_wo_ext) )
+ {
+ $url .= $fname_wo_ext;
+ break;
+ }
}
- break;
default:
$url .= $params['image_id'];
}