aboutsummaryrefslogtreecommitdiffstats
path: root/editproducts.cgi
diff options
context:
space:
mode:
authorjouni%heikniemi.net <>2004-07-20 12:06:18 +0000
committerjouni%heikniemi.net <>2004-07-20 12:06:18 +0000
commit0ed8d17388e304fe1d32f78d71a88597929236e5 (patch)
tree1fb17ad21c0b08ebb4d050d20ebc8ddff6e4d9c6 /editproducts.cgi
parentd2bec89f52e173f1e4b37928dc6fde463d0cc7ce (diff)
downloadbugs-0ed8d17388e304fe1d32f78d71a88597929236e5.tar
bugs-0ed8d17388e304fe1d32f78d71a88597929236e5.tar.gz
bugs-0ed8d17388e304fe1d32f78d71a88597929236e5.tar.bz2
bugs-0ed8d17388e304fe1d32f78d71a88597929236e5.tar.xz
bugs-0ed8d17388e304fe1d32f78d71a88597929236e5.zip
Bug 86051: Enable changing product name case.
Patch by GavinS <bugzilla@chimpychompy.org> r=jouni, a=justdave
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-xeditproducts.cgi20
1 files changed, 18 insertions, 2 deletions
diff --git a/editproducts.cgi b/editproducts.cgi
index c539465af..17bcfd703 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -306,13 +306,27 @@ if ($action eq 'new') {
PutTrailer($localtrailer);
exit;
}
- if (TestProduct($product)) {
+
+ my $existing_product = TestProduct($product);
+
+ # Check for exact case sensitive match:
+ if ($existing_product eq $product) {
print "The product '$product' already exists. Please press\n";
print "<b>Back</b> and try again.\n";
PutTrailer($localtrailer);
exit;
}
+ # Next check for a case-insensitive match:
+ if (lc($existing_product) eq lc($product)) {
+ print "The new product '$product' differs from existing product ";
+ print "'$existing_product' only in case. Please press\n";
+ print "<b>Back</b> and try again.\n";
+ PutTrailer($localtrailer);
+ exit;
+ }
+
+
my $version = trim($::FORM{version} || '');
if ($version eq '') {
@@ -1190,7 +1204,9 @@ if ($action eq 'update') {
PutTrailer($localtrailer);
exit;
}
- if (TestProduct($product)) {
+
+ if (lc($product) ne lc($productold) &&
+ TestProduct($product)) {
print "Sorry, product name '$product' is already in use.";
SendSQL("UNLOCK TABLES");
PutTrailer($localtrailer);