aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/attach.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/attach.php b/include/attach.php
index f5453096e..ac0185f5d 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -2144,6 +2144,10 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) {
$ext = '';
}
+ $matches = false;
+ if(preg_match('/(.*?)\([0-9]{1,}\)$/',$basename,$matches))
+ $basename = $matches[1];
+
$v = q("select filename from attach where ( filename = '%s' OR filename like '%s' ) and folder = '%s' ",
dbesc($basename . $ext),
dbesc($basename . '(%)' . $ext),