X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8cdbe23435d6a027d25c106c00ba34665fd54ed1..b6774bc6afac48e2c0a122647edc1485e7174a6e:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 5baa6c179..878869ef1 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -277,8 +277,9 @@ sub cgi_prefs ($$) { return; } elsif ($form->submitted eq 'Save Preferences' && $form->validate) { - if (defined $form->field('email')) { - userinfo_set($user_name, 'email', $form->field('email')) || + my $email = $form->field('email'); + if (defined $email) { + userinfo_set($user_name, 'email', $email) || error("failed to set email"); } @@ -460,6 +461,9 @@ sub cgi (;$$) { sub cgierror ($) { my $message=shift; + eval q{use HTML::Entities}; + $message = encode_entities($message); + print "Content-type: text/html\n\n"; print cgitemplate(undef, gettext("Error"), "

".gettext("Error").": $message

");