View | Details | Raw Unified | Return to bug 1985
Collapse All | Expand All

(-)a/opac/opac-review.pl (-17 / +16 lines)
Lines 59-77 if( !$biblio ) { Link Here
59
}
59
}
60
60
61
if( !@errors && defined $review ) {
61
if( !@errors && defined $review ) {
62
	if ($review !~ /\S/) {
62
    if ($review !~ /\S/) {
63
		push @errors, {empty=>1};
63
        push @errors, {empty=>1};
64
	} else {
64
    } else {
65
		$clean = C4::Scrubber->new('comment')->scrub($review);
65
        $clean = C4::Scrubber->new('comment')->scrub($review);
66
		if ($clean !~ /\S/) {
66
        if ($clean !~ /\S/) {
67
			push @errors, {scrubbed_all=>1};
67
            push @errors, {scrubbed_all=>1};
68
		} else {
68
        } else {
69
			if ($clean ne $review) {
69
            if ($clean ne $review) {
70
				push @errors, {scrubbed=>$clean};
70
                push @errors, {scrubbed=>$clean};
71
			}
71
            }
72
			my $js_ok_review = $clean;
72
            my $js_ok_review = $clean;
73
			$js_ok_review =~ s/"/"/g;	# probably redundant w/ TMPL ESCAPE=JS
73
            $js_ok_review =~ s/"/"/g;    # probably redundant w/ TMPL ESCAPE=JS
74
			$template->param(clean_review=>$js_ok_review);
74
            $template->param(clean_review=>$js_ok_review);
75
            if ($savedreview) {
75
            if ($savedreview) {
76
                $savedreview->set(
76
                $savedreview->set(
77
                    {
77
                    {
Lines 88-96 if( !@errors && defined $review ) { Link Here
88
                    }
88
                    }
89
                )->store->reviewid;
89
                )->store->reviewid;
90
            }
90
            }
91
			unless (@errors){ $template->param(WINDOW_CLOSE=>1); }
91
            unless (@errors){ $template->param(WINDOW_CLOSE=>1); }
92
		}
92
        }
93
	}
93
    }
94
}
94
}
95
(@errors   ) and $template->param(   ERRORS=>\@errors);
95
(@errors   ) and $template->param(   ERRORS=>\@errors);
96
($cgi_debug) and $template->param(cgi_debug=>1       );
96
($cgi_debug) and $template->param(cgi_debug=>1       );
97
- 

Return to bug 1985