Commit c8242c1e authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Backing out bug 238780 (Edit versions should reject newline characters) - This…

Backing out bug 238780 (Edit versions should reject newline characters) - This patch prevents you to edit or delete existing versions having control characters.
parent 955e6155
...@@ -42,7 +42,7 @@ use base qw(Exporter); ...@@ -42,7 +42,7 @@ use base qw(Exporter);
format_time format_time_decimal validate_date format_time format_time_decimal validate_date
file_mod_time is_7bit_clean file_mod_time is_7bit_clean
bz_crypt generate_random_password bz_crypt generate_random_password
validate_email_syntax clean_text); validate_email_syntax);
use Bugzilla::Config; use Bugzilla::Config;
use Bugzilla::Constants; use Bugzilla::Constants;
...@@ -390,12 +390,6 @@ sub is_7bit_clean { ...@@ -390,12 +390,6 @@ sub is_7bit_clean {
return $_[0] !~ /[^\x20-\x7E\x0A\x0D]/; return $_[0] !~ /[^\x20-\x7E\x0A\x0D]/;
} }
sub clean_text {
my ($dtext) = shift;
$dtext =~ s/[\x00-\x1F\x7F]/ /g; # change control characters to spaces
return $dtext;
}
1; 1;
__END__ __END__
...@@ -645,10 +639,6 @@ into the string. ...@@ -645,10 +639,6 @@ into the string.
Returns true is the string contains only 7-bit characters (ASCII 32 through 126, Returns true is the string contains only 7-bit characters (ASCII 32 through 126,
ASCII 10 (LineFeed) and ASCII 13 (Carrage Return). ASCII 10 (LineFeed) and ASCII 13 (Carrage Return).
=item C<clean_text($str)>
Returns the parameter "cleaned" by exchanging non-printable characters with spaces.
Specifically characters (ASCII 0 through 31) and (ASCII 127) will become ASCII 32 (Space).
=back =back
=head2 Formatting Time =head2 Formatting Time
......
...@@ -130,9 +130,6 @@ if ($action eq 'new') { ...@@ -130,9 +130,6 @@ if ($action eq 'new') {
# Cleanups and valididy checks # Cleanups and valididy checks
$version_name || ThrowUserError('version_blank_name'); $version_name || ThrowUserError('version_blank_name');
# Remove unprintable characters
$version_name = clean_text($version_name);
my $version = new Bugzilla::Version($product->id, $version_name); my $version = new Bugzilla::Version($product->id, $version_name);
if ($version) { if ($version) {
ThrowUserError('version_already_exists', ThrowUserError('version_already_exists',
...@@ -245,10 +242,6 @@ if ($action eq 'edit') { ...@@ -245,10 +242,6 @@ if ($action eq 'edit') {
if ($action eq 'update') { if ($action eq 'update') {
$version_name || ThrowUserError('version_not_specified'); $version_name || ThrowUserError('version_not_specified');
# Remove unprintable characters
$version_name = clean_text($version_name);
my $version_old_name = trim($cgi->param('versionold') || ''); my $version_old_name = trim($cgi->param('versionold') || '');
my $version_old = my $version_old =
Bugzilla::Version::check_version($product, Bugzilla::Version::check_version($product,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment