Skip to content

Commit

Permalink
Escape error messages from OpenID
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jun 17, 2016
1 parent 1363ce5 commit 94cf386
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/openid.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function Show_page($contents)
$o = new OpenID_RelyingParty($returnTo, $realm, $identifier);
} catch (Exception $e) {
$contents = "<div class='relyingparty_results'>\n";
$contents .= "<pre>" . $e->getMessage() . "</pre>\n";
$contents .= "<pre>" . htmlspecialchars($e->getMessage()) . "</pre>\n";
$contents .= "</div class='relyingparty_results'>";
Show_page($contents);
exit;
Expand All @@ -121,9 +121,9 @@ function Show_page($contents)
if (isset($_POST['start'])) {
try {
$authRequest = $o->prepare();
} catch (OpenID_Exception $e) {
} catch (Exception $e) {
$contents = "<div class='relyingparty_results'>\n";
$contents .= "<pre>" . $e->getMessage() . "</pre>\n";
$contents .= "<pre>" . htmlspecialchars($e->getMessage()) . "</pre>\n";
$contents .= "</div class='relyingparty_results'>";
Show_page($contents);
exit;
Expand Down

0 comments on commit 94cf386

Please sign in to comment.