summaryrefslogtreecommitdiff
path: root/profileinfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'profileinfo.php')
-rw-r--r--profileinfo.php41
1 files changed, 23 insertions, 18 deletions
diff --git a/profileinfo.php b/profileinfo.php
index d1cf8536..01e3f0aa 100644
--- a/profileinfo.php
+++ b/profileinfo.php
@@ -69,7 +69,8 @@ require_once( './includes/GlobalFunctions.php' );
<?php
if (!$wgEnableProfileInfo) {
- echo "disabled\n";
+ echo "<p>Disabled</p>\n";
+ echo "</body></html>";
exit( 1 );
}
@@ -113,7 +114,7 @@ class profile_point {
else $ex = false;
if (!$ex) {
if (count($this->children)) {
- $url = makeurl(false, false, $expand + array($this->name() => true));
+ $url = getEscapedProfileUrl(false, false, $expand + array($this->name() => true));
$extet = " <a href=\"$url\">[+]</a>";
} else $extet = '';
} else {
@@ -122,7 +123,7 @@ class profile_point {
if ($name != $this->name())
$e += array($name => $ep);
- $extet = " <a href=\"" . makeurl(false, false, $e) . "\">[&ndash;]</a>";
+ $extet = " <a href=\"" . getEscapedProfileUrl(false, false, $e) . "\">[&ndash;]</a>";
}
?>
<tr>
@@ -244,31 +245,35 @@ else $filter = '';
<table cellspacing="0" border="1">
<tr id="top">
-<th><a href="<?php echo makeurl(false, "name") ?>">Name</a></th>
-<th><a href="<?php echo makeurl(false, "time") ?>">Time (%)</a></th>
-<th><a href="<?php echo makeurl(false, "memory") ?>">Memory (%)</a></th>
-<th><a href="<?php echo makeurl(false, "count") ?>">Count</a></th>
-<th><a href="<?php echo makeurl(false, "calls_per_req") ?>">Calls/req</a></th>
-<th><a href="<?php echo makeurl(false, "time_per_call") ?>">ms/call</a></th>
-<th><a href="<?php echo makeurl(false, "memory_per_call") ?>">kb/call</a></th>
-<th><a href="<?php echo makeurl(false, "time_per_req") ?>">ms/req</a></th>
-<th><a href="<?php echo makeurl(false, "memory_per_req") ?>">kb/req</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "name") ?>">Name</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "time") ?>">Time (%)</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "memory") ?>">Memory (%)</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "count") ?>">Count</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "calls_per_req") ?>">Calls/req</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "time_per_call") ?>">ms/call</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "memory_per_call") ?>">kb/call</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "time_per_req") ?>">ms/req</a></th>
+<th><a href="<?php echo getEscapedProfileUrl(false, "memory_per_req") ?>">kb/req</a></th>
</tr>
<?php
$totaltime = 0.0;
$totalcount = 0;
$totalmemory = 0.0;
-function makeurl($_filter = false, $_sort = false, $_expand = false) {
+function getEscapedProfileUrl( $_filter = false, $_sort = false, $_expand = false ) {
global $filter, $sort, $expand;
- if ($_expand === false)
+ if ( $_expand === false )
$_expand = $expand;
- $nfilter = $_filter ? $_filter : $filter;
- $nsort = $_sort ? $_sort : $sort;
- $exp = urlencode(implode(',', array_keys($_expand)));
- return "?filter=$nfilter&amp;sort=$nsort&amp;expand=$exp";
+ return htmlspecialchars(
+ '?' .
+ wfArrayToCGI( array(
+ 'filter' => $_filter ? $_filter : $filter,
+ 'sort' => $_sort ? $_sort : $sort,
+ 'expand' => implode( ',', array_keys( $_expand ) )
+ ) )
+ );
}
$points = array();