Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #744 from versionpress/637-escape-echoed-variables
Browse files Browse the repository at this point in the history
Late escape all echoed variables
  • Loading branch information
JanVoracek committed Mar 8, 2016
2 parents d1ad568 + 0a5643e commit 42bf581
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugins/versionpress/admin/deactivate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* @param string $cssClass Optional CSS class to be used for the button
*/
function _vp_button($label, $action, $type = "delete", $cssClass = "") {
echo "<form action='" . admin_url('admin-post.php') . "' method='post' class='$cssClass'>";
echo "<form action='" . esc_url(admin_url('admin-post.php')) . "' method='post' class='" . esc_attr($cssClass) . "'>";
echo "<input type='hidden' name='action' value='$action' />";
submit_button($label, $type, $action, false, $other_attributes = array("id" => $action) );
submit_button($label, $type, $action, false, $other_attributes = array("id" => $action));
echo "</form>";
}

Expand Down
10 changes: 5 additions & 5 deletions plugins/versionpress/admin/inc/activationPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
$iconClass = $requirement["fulfilled"] ? "icon-checkmark" : "icon-warning";
?>
<li>
<span class="icon <?php echo $iconClass; ?>"></span>
<?php echo $requirement["name"]; ?>
<span class="icon <?php echo esc_attr($iconClass); ?>"></span>
<?php echo esc_html($requirement["name"]); ?>
<p class="<?php echo $requirement["fulfilled"] ? 'closed' : 'open'; ?>">
<?php echo Markdown::transform($requirement["help"]); ?>
</p>
Expand All @@ -55,7 +55,7 @@
?>
</ul>

<div><a href="<?php echo admin_url('admin.php?page=versionpress/admin/system-info.php') ?>">View full system info</a><?php if (!$requirementsChecker->isWithoutCriticalErrors()) { ?>, <a href="https://github.com/versionpress/support">get support on GitHub</a><?php } ?></div>
<div><a href="<?php echo esc_url(admin_url('admin.php?page=versionpress/admin/system-info.php')) ?>">View full system info</a><?php if (!$requirementsChecker->isWithoutCriticalErrors()) { ?>, <a href="https://github.com/versionpress/support">get support on GitHub</a><?php } ?></div>

</div>

Expand Down Expand Up @@ -92,8 +92,8 @@
$buttonClass = "button-primary-disabled";
}
?>
<a href="<?php echo $activationUrl; ?>"
class="button <?php echo $buttonClass; ?> button-hero" id="activate-versionpress-btn">Activate
<a href="<?php echo esc_url($activationUrl); ?>"
class="button <?php echo esc_attr($buttonClass); ?> button-hero" id="activate-versionpress-btn">Activate
VersionPress</a>
</div>

Expand Down
6 changes: 3 additions & 3 deletions plugins/versionpress/admin/system-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function vp_display_system_info_array($array, $outputFormat) {
case 've': // var_export

echo '<pre><code style="language-php">';
echo htmlspecialchars(var_export($array, true));
echo esc_html(var_export($array, true));
echo '</code></pre>';

break;
Expand Down Expand Up @@ -66,8 +66,8 @@ function vp_display_system_info_array($array, $outputFormat) {

<div>
Format:
<a href="<?php echo admin_url('admin.php?page=versionpress/admin/system-info.php&f=ve') ?>">var_export</a> |
<a href="<?php echo admin_url('admin.php?page=versionpress/admin/system-info.php&f=tc') ?>">tracy</a>
<a href="<?php echo esc_url(admin_url('admin.php?page=versionpress/admin/system-info.php&f=ve')) ?>">var_export</a> |
<a href="<?php echo esc_url(admin_url('admin.php?page=versionpress/admin/system-info.php&f=tc')) ?>">tracy</a>

<br />

Expand Down

0 comments on commit 42bf581

Please sign in to comment.