PREP 2013 Question Authoring - Archived

Unexpected "Warning" started appearing

Unexpected "Warning" started appearing

by Joe Wagner -
Number of replies: 3
I had two problems working just fine, and then I went on to work on another that I never got working.  When I returned to the two earlier problems, even though I had not changed/edited them, a red  "WARNNG" box began to appear:

Use of uninitialized value in subroutine entry at /usr/local/share/perl/5.14.2/HTML/Scrubber.pm line 184.

Any idea what's going on?   The problems still function properly, but the warning keeps appearing every time I "try" them.


In reply to Joe Wagner

Re: Unexpected "Warning" started appearing

by Gavin LaRose -
Hi Joe,

Looking at your problem, I'm seeing the error anytime I enter the problem without submitting it. Given that and the "use of uninitialized value" error, my first guess is that there is something odd with a stored last answer for the problem. I've seen similar types of things when I've created a problem that had multiple answer blanks and then went back to fewer and had stored answers for problem blanks that didn't exist anymore.

To test this, I created a new set for myself which has that problem in it, and it did not show the error. So I next tried unassigning the set from you and reassigning it, which (I think) has cleared out the error. That doesn't mean that my diagnosis was correct, but is at least consistent.

Let us know if you see this again. There are others who know better where HTML::Scrubber is being used in the code, and they may be able to provide more insight on what's going on here.

Gavin

In reply to Gavin LaRose

Re: Unexpected "Warning" started appearing

by Michael Gage -
HTML::Scrubber is being used to sanitize any message that is printed to the HTML page.  This prevents cross site scripting (XSS) where javaScript is deliberately inserted into an answer blank to cause a failure, a warning message (and if that warning message contains unprocessed javaScript) causes the browser to execute the javaScript command.  Not good.

In this case it merely means the string sent to HTML::Scrubber was blank.  Keep us informed if and when this continues to happen and we'll figure out how to provide a friendlier warning message.
In reply to Joe Wagner

Re: Unexpected "Warning" started appearing

by Douglas Brown -
I had the same thing happen to me this morning - three problems that were working fine yesterday started generating this message today.Gavin's fix above worked for me as well.