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
8508ede5
Commit
8508ede5
authored
Jan 09, 2006
by
mozilla%colinogilvie.co.uk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 101380: Newlines, nulls, leading/trailing spaces are getting into summaries
Patch by Paul <pdemarco@zoominternet.net> and Colin Ogilvie <colin.ogilvie@gmail.com>; r/a=justdave
parent
94232797
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
Util.pm
Bugzilla/Util.pm
+2
-2
checksetup.pl
checksetup.pl
+18
-0
post_bug.cgi
post_bug.cgi
+4
-1
process_bug.cgi
process_bug.cgi
+1
-0
No files found.
Bugzilla/Util.pm
View file @
8508ede5
...
...
@@ -392,8 +392,8 @@ sub is_7bit_clean {
sub
clean_text
{
my
(
$dtext
)
=
shift
;
$dtext
=~
s/[\x00-\x1F\x7F]
/ /g
;
# change control characters to spaces
return
$dtext
;
$dtext
=~
s/[\x00-\x1F\x7F]
+/ /g
;
# change control characters into a space
return
trim
(
$dtext
)
;
}
1
;
...
...
checksetup.pl
View file @
8508ede5
...
...
@@ -4239,6 +4239,24 @@ $dbh->bz_alter_column('groups', 'userregexp',
$dbh
->
bz_alter_column
(
'logincookies'
,
'cookie'
,
{
TYPE
=>
'varchar(16)'
,
PRIMARYKEY
=>
1
,
NOTNULL
=>
1
});
# Fixup for Bug 101380
# "Newlines, nulls, leading/trailing spaces are getting into summaries"
my
$controlchar_bugs
=
$dbh
->
selectall_arrayref
(
"SELECT short_desc, bug_id FROM bugs WHERE "
.
$dbh
->
sql_regexp
(
'short_desc'
,
"'[[:cntrl:]]'"
));
if
(
@$controlchar_bugs
)
{
print
'Cleaning control characters from bug summaries...'
;
foreach
(
@$controlchar_bugs
)
{
my
(
$short_desc
,
$bug_id
)
=
@$_
;
print
" $bug_id..."
;
$short_desc
=
clean_text
(
$short_desc
);
$dbh
->
do
(
"UPDATE bugs SET short_desc = ? WHERE bug_id = ?"
,
undef
,
$short_desc
,
$bug_id
);
}
print
" done.\n"
;
}
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
...
...
post_bug.cgi
View file @
8508ede5
...
...
@@ -108,8 +108,11 @@ my $component_id = get_component_id($product_id,
scalar
(
$cgi
->
param
(
'component'
)));
$component_id
||
ThrowUserError
(
"require_component"
);
# Set the parameter to itself, but cleaned up
$cgi
->
param
(
'short_desc'
,
clean_text
(
$cgi
->
param
(
'short_desc'
)));
if
(
!
defined
$cgi
->
param
(
'short_desc'
)
||
trim
(
$cgi
->
param
(
'short_desc'
)
)
eq
""
)
{
||
$cgi
->
param
(
'short_desc'
)
eq
""
)
{
ThrowUserError
(
"require_summary"
);
}
...
...
process_bug.cgi
View file @
8508ede5
...
...
@@ -611,6 +611,7 @@ if (defined $cgi->param('id')) {
check_form_field_defined
(
$cgi
,
'bug_file_loc'
);
check_form_field_defined
(
$cgi
,
'short_desc'
);
check_form_field_defined
(
$cgi
,
'longdesclength'
);
$cgi
->
param
(
'short_desc'
,
clean_text
(
$cgi
->
param
(
'short_desc'
)));
if
(
trim
(
$cgi
->
param
(
'short_desc'
))
eq
""
)
{
ThrowUserError
(
"require_summary"
);
...
...
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