X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=profileinfo.php;h=7b652b74d5d0cc42a61272ed7c5b96df0e38551c;hb=b8c23cf81ec89f97ecc975b714260f634407f10f;hp=264b5eb1c3890797f36031089c26df708ed72a9c;hpb=f7e3ee20bb0384ff81752df8e53beca07c339304;p=lhc%2Fweb%2Fwiklou.git diff --git a/profileinfo.php b/profileinfo.php index 264b5eb1c3..7b652b74d5 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -37,9 +37,10 @@ */ // This endpoint is supposed to be independent of request cookies and other -// details of the session. Log warnings for violations of the no-session -// constraint. -define( 'MW_NO_SESSION', 'warn' ); +// details of the session. Enforce this constraint with respect to session use. +define( 'MW_NO_SESSION', 1 ); + +define( 'MW_ENTRY_POINT', 'profileinfo' ); ini_set( 'zlib.output_compression', 'off' ); @@ -294,7 +295,7 @@ class profile_point { public function fmttime() { return sprintf( '%5.02f', $this->time ); } -}; +} function compare_point( profile_point $a, profile_point $b ) { // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix @@ -339,11 +340,7 @@ $res = $dbr->select( [ 'ORDER BY' => 'pf_name ASC' ] ); -if ( isset( $_REQUEST['filter'] ) ) { - $filter = $_REQUEST['filter']; -} else { - $filter = ''; -} +$filter = $_REQUEST['filter'] ?? ''; ?>
@@ -417,6 +414,7 @@ if ( isset( $_REQUEST['filter'] ) ) { $queries = []; $sqltotal = 0.0; + /** @var profile_point|false $last */ $last = false; foreach ( $res as $o ) { $next = new profile_point( $o->pf_name, $o->pf_count, $o->pf_time, $o->pf_memory ); @@ -440,7 +438,7 @@ if ( isset( $_REQUEST['filter'] ) ) { } } - $s = new profile_point( 'SQL Queries', 0, $sqltotal, 0, 0 ); + $s = new profile_point( 'SQL Queries', 0, $sqltotal, 0 ); foreach ( $queries as $q ) { $s->add_child( $q ); }