summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authormozilla%colinogilvie.co.uk <>2006-01-09 04:56:03 +0100
committermozilla%colinogilvie.co.uk <>2006-01-09 04:56:03 +0100
commit8508ede5763d9d98d8c4fc755847752d192c2126 (patch)
tree52943273ee4f76b7121d9568ce528e585d3c44a2 /checksetup.pl
parent94232797b7ea157c75ee92a9830993fbff1caad1 (diff)
downloadbugzilla-8508ede5763d9d98d8c4fc755847752d192c2126.tar.gz
bugzilla-8508ede5763d9d98d8c4fc755847752d192c2126.tar.xz
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
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/checksetup.pl b/checksetup.pl
index e8528aee1..56db99b46 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -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.