diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 10:05:59 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 10:05:59 +0200 |
commit | 00ab76a6b686e98a914afc1975812d2b1aaa7016 (patch) | |
tree | 0509bcf2b8a30056833a289e3717b55bdb189835 /profileinfo.php | |
parent | a5be612e4169e11b51647cbaa2abc976de00d671 (diff) |
update to MediaWiki 1.15.5
Diffstat (limited to 'profileinfo.php')
-rw-r--r-- | profileinfo.php | 41 |
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) . "\">[–]</a>"; + $extet = " <a href=\"" . getEscapedProfileUrl(false, false, $e) . "\">[–]</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&sort=$nsort&expand=$exp"; + return htmlspecialchars( + '?' . + wfArrayToCGI( array( + 'filter' => $_filter ? $_filter : $filter, + 'sort' => $_sort ? $_sort : $sort, + 'expand' => implode( ',', array_keys( $_expand ) ) + ) ) + ); } $points = array(); |