SECURITY Sanitize messages passed to generated JS calls in FormResponse::status_message(), e.g. to avoid XSS on 'Successfully published <page title>' messages

This commit is contained in:
Ingo Schommer 2012-01-31 15:01:59 +01:00
parent 84f47f5c86
commit 5fe7091dff

View File

@ -148,8 +148,8 @@ class FormResponse {
* @param $status string
*/
static function status_message($message = "", $status = null) {
$JS_message = Convert::raw2js($message);
$JS_status = Convert::raw2js($status);
$JS_message = Convert::raw2js(Convert::raw2xml($message));
$JS_status = Convert::raw2js(Convert::raw2xml($status));
if(isset($JS_status)) {
self::$status_messages[$JS_status] = "statusMessage('{$JS_message}', '{$JS_status}');";
} else {