Author: jfthomps
Date: Thu Nov 15 21:01:46 2012
New Revision: 1410009

URL: http://svn.apache.org/viewvc?rev=1410009&view=rev
Log:
VCL-628
check for duplicate image name not correctly performed when specified name is 
the same as the base image

images.php: modified processImageInput - pass empty value for $imageid when 
calling checkForImageName if adding a new image

Modified:
    vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/images.php

Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/images.php
URL: 
http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/images.php?rev=1410009&r1=1410008&r2=1410009&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/images.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/images.php Thu Nov 15 21:01:46 
2012
@@ -3085,10 +3085,15 @@ function processImageInput($checks=1) {
                $submitErrMsg[PRETTYNAMEERR] = "Name can only contain 
alphabets, numbers, signs, and spaces.";
        }
 
-       if(! ($submitErr & PRETTYNAMEERR) &&
-          checkForImageName($return["prettyname"], "long", 
$return["imageid"])) {
-          $submitErr |= PRETTYNAMEERR;
-          $submitErrMsg[PRETTYNAMEERR] = "An image already exists with this 
name.";
+       if(! ($submitErr & PRETTYNAMEERR)) {
+               if($return['requestid'] == '')
+                       $imageid = $return['imageid'];
+               else
+                       $imageid = '';
+               if(checkForImageName($return["prettyname"], "long", $imageid)) {
+                       $submitErr |= PRETTYNAMEERR;
+                       $submitErrMsg[PRETTYNAMEERR] = "An image already exists 
with this name.";
+               }
        }
        if($return["minram"] < 0 || $return["minram"] > 20480) {
           $submitErr |= MINRAMERR;


Reply via email to