Index: trunk/phase3/profileinfo.php |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | else $ex = false; |
105 | 105 | if ( !$ex ) { |
106 | 106 | if ( count( $this->children ) ) { |
107 | | - $url = makeurl( false, false, $expand + array( $this->name() => true ) ); |
| 107 | + $url = getEscapedProfileUrl( false, false, $expand + array( $this->name() => true ) ); |
108 | 108 | $extet = " <a href=\"$url\">[+]</a>"; |
109 | 109 | } else $extet = ''; |
110 | 110 | } else { |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | if ( $name != $this->name() ) |
114 | 114 | $e += array( $name => $ep ); |
115 | 115 | |
116 | | - $extet = " <a href=\"" . makeurl( false, false, $e ) . "\">[–]</a>"; |
| 116 | + $extet = " <a href=\"" . getEscapedProfileUrl( false, false, $e ) . "\">[–]</a>"; |
117 | 117 | } |
118 | 118 | ?> |
119 | 119 | <tr> |
— | — | @@ -231,31 +231,35 @@ |
232 | 232 | |
233 | 233 | <table cellspacing="0" border="1"> |
234 | 234 | <tr id="top"> |
235 | | -<th><a href="<?php echo makeurl( false, 'name' ) ?>">Name</a></th> |
236 | | -<th><a href="<?php echo makeurl( false, 'time' ) ?>">Time (%)</a></th> |
237 | | -<th><a href="<?php echo makeurl( false, 'memory' ) ?>">Memory (%)</a></th> |
238 | | -<th><a href="<?php echo makeurl( false, 'count' ) ?>">Count</a></th> |
239 | | -<th><a href="<?php echo makeurl( false, 'calls_per_req' ) ?>">Calls/req</a></th> |
240 | | -<th><a href="<?php echo makeurl( false, 'time_per_call' ) ?>">ms/call</a></th> |
241 | | -<th><a href="<?php echo makeurl( false, 'memory_per_call' ) ?>">kb/call</a></th> |
242 | | -<th><a href="<?php echo makeurl( false, 'time_per_req' ) ?>">ms/req</a></th> |
243 | | -<th><a href="<?php echo makeurl( false, 'memory_per_req' ) ?>">kb/req</a></th> |
| 235 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'name' ) ?>">Name</a></th> |
| 236 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'time' ) ?>">Time (%)</a></th> |
| 237 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'memory' ) ?>">Memory (%)</a></th> |
| 238 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'count' ) ?>">Count</a></th> |
| 239 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'calls_per_req' ) ?>">Calls/req</a></th> |
| 240 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'time_per_call' ) ?>">ms/call</a></th> |
| 241 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'memory_per_call' ) ?>">kb/call</a></th> |
| 242 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'time_per_req' ) ?>">ms/req</a></th> |
| 243 | +<th><a href="<?php echo getEscapedProfileUrl( false, 'memory_per_req' ) ?>">kb/req</a></th> |
244 | 244 | </tr> |
245 | 245 | <?php |
246 | 246 | $totaltime = 0.0; |
247 | 247 | $totalcount = 0; |
248 | 248 | $totalmemory = 0.0; |
249 | 249 | |
250 | | -function makeurl( $_filter = false, $_sort = false, $_expand = false ) { |
| 250 | +function getEscapedProfileUrl( $_filter = false, $_sort = false, $_expand = false ) { |
251 | 251 | global $filter, $sort, $expand; |
252 | 252 | |
253 | 253 | if ( $_expand === false ) |
254 | 254 | $_expand = $expand; |
255 | 255 | |
256 | | - $nfilter = $_filter ? htmlspecialchars( $_filter ) : htmlspecialchars( $filter ); |
257 | | - $nsort = $_sort ? htmlspecialchars( $_sort ) : htmlspecialchars( $sort ); |
258 | | - $exp = urlencode( implode( ',', array_keys( $_expand ) ) ); |
259 | | - return "?filter=$nfilter&sort=$nsort&expand=$exp"; |
| 256 | + return htmlspecialchars( |
| 257 | + '?' . |
| 258 | + wfArrayToCGI( array( |
| 259 | + 'filter' => $_filter ? $_filter : $filter, |
| 260 | + 'sort' => $_sort ? $_sort : $sort, |
| 261 | + 'expand' => implode( ',', array_keys( $_expand ) ) |
| 262 | + ) ) |
| 263 | + ); |
260 | 264 | } |
261 | 265 | |
262 | 266 | $points = array(); |