Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Commit 0aa1c72

Browse files
committed
Merge pull request #99 from katzwebservices/zackkatz-patch-1
Sanitize example PHP
2 parents 317a7c1 + fccd50b commit 0aa1c72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/getAccessToken.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
if (isset($_GET['error'])) {
3939
echo '<span class="label label-important">OAuth2 Error!</span>';
4040
echo '<div class="container alert-error"><pre class="failure-pre">';
41-
echo 'Error: ' . $_GET['error'];
42-
echo '<br />Description: ' . $_GET['error_description'];
41+
echo 'Error: ' . htmlspecialchars( $_GET['error'] );
42+
echo '<br />Description: ' . htmlspecialchars( $_GET['error_description'] );
4343
echo '</pre></div>';
4444
die();
4545
}
@@ -51,14 +51,14 @@
5151
} catch (OAuth2Exception $ex) {
5252
echo '<span class="label label-important">OAuth2 Error!</span>';
5353
echo '<div class="container alert-error"><pre class="failure-pre">';
54-
echo 'Error: ' . $ex->getMessage();
54+
echo 'Error: ' . htmlspecialchars( $ex->getMessage() );
5555
echo '</pre></div>';
5656
die();
5757
}
5858

5959
echo '<span class="label label-success">Access Token Retrieved!</span>';
6060
echo '<div class="container alert-success"><pre class="success-pre">';
61-
print_r($accessToken);
61+
print_r( htmlspecialchars( $accessToken ) );
6262
echo '</pre></div>';
6363

6464
} else {

0 commit comments

Comments
 (0)