From 163db3f30ff8ff23c6f985d8f941337800fcdfd5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 25 Aug 2019 15:03:33 -0700 Subject: [PATCH] Avoid PHP warning due to bogus second tideways_xhprof_enable() argument Change-Id: I3d86d74e8a97eb578f392f9f1d918cc628d2bf4b --- includes/libs/Xhprof.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php index a1ddfd0772..575fbe754e 100644 --- a/includes/libs/Xhprof.php +++ b/includes/libs/Xhprof.php @@ -53,6 +53,12 @@ class Xhprof { if ( self::isEnabled() ) { throw new Exception( 'Profiling is already enabled.' ); } + + $args = [ $flags ]; + if ( $options ) { + $args[] = $options; + } + self::$enabled = true; self::callAny( [ @@ -60,7 +66,7 @@ class Xhprof { 'tideways_enable', 'tideways_xhprof_enable' ], - [ $flags, $options ] + $args ); } -- 2.20.1