aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/upload.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/actions/upload.php b/actions/upload.php
index 797a4dfce..2f84a9f6b 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -161,7 +161,12 @@
if( $watermark_text ) { //get this value from the plugin settings
if( $thumblarge ) {
$ext = ".png";
- $user_stamp_base = dirname(__FILE__) . "/" . $username . "_stamp";
+
+ $watermark_filename = strtolower($watermark_text);
+ $watermark_filename = preg_replace("/[^\w-]+/", "-", $watermark_filename);
+ $watermark_filename = trim($watermark_filename, '-');
+
+ $user_stamp_base = dirname(__FILE__) . "/" . $username . "_" . $watermark_filename . "_stamp";
if( !file_exists( $user_stamp_base . $ext )) { //create the watermark if it doesn't exist
$commands = array();
$commands[] = 'convert -size 300x50 xc:grey30 -pointsize 20 -gravity center -draw "fill grey70 text 0,0 \''. $watermark_text . '\'" '. $user_stamp_base . '_fgnd' . $ext;