bugzilla gets internal error if bug id starts with zero

RESOLVED FIXED in Bugzilla 2.18

Status

()

defect
RESOLVED FIXED
16 years ago
7 years ago

People

(Reporter: legion, Assigned: legion)

Tracking

unspecified
Bugzilla 2.18
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

532 bytes, patch
justdave
: review+
Details | Diff | Splinter Review
Assignee

Description

16 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.3a) Gecko/20021215 Phoenix/0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.3a) Gecko/20021215 Phoenix/0.5

bugzilla 2.17.4 get error when get URL: 
http:// ... /show_bug.cgi?id=01
the database contians bug with id #1, but in Bug.pm at line 114 this bug is to
be converted into alias. I know alias of bug may be any string, but maybe best
solution is return to search bug if id is not alias and starts from zero.



Reproducible: Always

Steps to Reproduce:
1. 
2.
3.
Assignee

Comment 1

16 years ago
Posted patch Bug.patch (obsolete) — Splinter Review
Comment on attachment 130547 [details] [diff] [review]
Bug.patch

I think the proper solution here is to make the bug alias lookup regexp given a
couple lines earlier allow zero in the first digit. (i.e. remove the [1-9] from
the front of the regexp and change the * to a + on the end.
Attachment #130547 - Flags: review-

Comment 3

16 years ago
Also, indentation seems broken on that patch. Alexey, did you mix tabs and
spaces? The policy for Bugzilla (and all Mozilla projects) is "no tabs".
forgot to mention, the fix you gave would cause problems if you passed a
bug_id=0abc or example, because the leading 0 would throw it off and make it
think it was a number with your test.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: bugzilla get internal error if bug id starts from zero → bugzilla gets internal error if bug id starts with zero
Assignee

Comment 5

16 years ago
Ups! Sorry ! i will be more careful when i will make attachents again. Yes, this
patch is not fix this problem. You right, best solution is remove the [1-9] from
regexp.
*** Bug 235079 has been marked as a duplicate of this bug. ***
Alexey: were you going to update your patch, or would you like someone else to
go ahead and take care of it?
Assignee

Comment 8

15 years ago
Posted patch new solutionSplinter Review
Attachment #130547 - Attachment is obsolete: true
Assignee

Comment 9

15 years ago
I think the solution may be more simple. We must consider leading '0' at the bug 
alias lookup and bug id must contain at least one non-'0' number.
Comment on attachment 148820 [details] [diff] [review]
new solution

>+  $bug_id = &::BugAliasToID($bug_id) if $bug_id !~ /^0*[1-9][0-9]*$/;

I was originally thinking this was overkill when I first saw it, but then I
realized you've hit it straight on. :)	"0" isn't a legal bug number, and your
new regexp allows leading zeros, but still ensures that the entire number isn't
"0" itself :)  I think that'll work nicely.
Attachment #148820 - Flags: review+
-> patch author
a= justdave

You need someone to check this in for you, right?
Assignee: myk → legion
Flags: approval+
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.18
Assignee

Comment 12

15 years ago
Yes. So bug is closed?

Comment 13

15 years ago
FIXED.

Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.35; previous revision: 1.34
done
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED

Comment 14

15 years ago
(In reply to comment #12)
> Yes. So bug is closed?

Nope. A bug gets RESOLVED FIXED when the actual patch is commited in the
mozilla.org CVS. It's usually marked as FIXED by the CVS commiter.
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.