Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
ca07b6eb
Commit
ca07b6eb
authored
May 21, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 292718: LOCATE is not ANSI SQL (prevents user account creation)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=joel, a=justdave
parent
3dabf17d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
User.pm
Bugzilla/User.pm
+8
-5
No files found.
Bugzilla/User.pm
View file @
ca07b6eb
...
...
@@ -1091,8 +1091,9 @@ sub insert_new_user ($$;$$) {
# Insert the new user record into the database.
$dbh
->
do
(
"INSERT INTO profiles
(login_name, realname, cryptpassword, disabledtext)
VALUES (?, ?, ?, ?)"
,
(login_name, realname, cryptpassword, disabledtext,
refreshed_when)
VALUES (?, ?, ?, ?, '1901-01-01 00:00:00')"
,
undef
,
(
$username
,
$realname
,
$cryptpassword
,
$disabledtext
));
...
...
@@ -1133,12 +1134,14 @@ sub is_available_username ($;$) {
#
# substring/locate stuff: bug 165221; this used to use regexes, but that
# was unsafe and required weird escaping; using substring to pull out
# the new/old email addresses and
locate() to find the delime
ter (':')
# the new/old email addresses and
sql_position() to find the delimi
ter (':')
# is cleaner/safer
my
$sth
=
$dbh
->
prepare
(
"SELECT eventdata FROM tokens WHERE tokentype = 'emailold'
AND SUBSTRING(eventdata, 1, (LOCATE(':', eventdata) - 1)) = ?
OR SUBSTRING(eventdata, (LOCATE(':', eventdata) + 1)) = ?"
);
AND SUBSTRING(eventdata, 1, ("
.
$dbh
->
sql_position
(
q{':'}
,
'eventdata'
)
.
"- 1)) = ?
OR SUBSTRING(eventdata, ("
.
$dbh
->
sql_position
(
q{':'}
,
'eventdata'
)
.
"+ 1)) = ?"
);
$sth
->
execute
(
$username
,
$username
);
if
(
my
(
$eventdata
)
=
$sth
->
fetchrow_array
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment