GlobalFunctions: Fix 'Undefined index' notice in wfBacktrace
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index dafa48b..1cb2f56 100644 (file)
@@ -1081,7 +1081,7 @@ function wfDebugMem( $exact = false ) {
  * @param string|bool $dest Destination of the message:
  *     - 'all': both to the log and HTML (debug toolbar or HTML comments)
  *     - 'log': only to the log and not in HTML
- *     - 'private': only to the specifc log if set in $wgDebugLogGroups and
+ *     - 'private': only to the specific log if set in $wgDebugLogGroups and
  *       discarded otherwise
  *   For backward compatibility, it can also take a boolean:
  *     - true: same as 'all'
@@ -1837,7 +1837,7 @@ function wfBacktrace( $raw = null ) {
 
        $frames = array_map( function ( $frame ) use ( $frameFormat ) {
                $file = !empty( $frame['file'] ) ? basename( $frame['file'] ) : '-';
-               $line = $frame['line'] ?: '-';
+               $line = isset( $frame['line'] ) ? $frame['line'] : '-';
                $call = $frame['function'];
                if ( !empty( $frame['class'] ) ) {
                        $call = $frame['class'] . $frame['type'] . $call;
@@ -3551,7 +3551,7 @@ function wfSplitWikiID( $wiki ) {
  *
  * @return DatabaseBase
  */
-function &wfGetDB( $db, $groups = array(), $wiki = false ) {
+function wfGetDB( $db, $groups = array(), $wiki = false ) {
        return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );
 }
 
@@ -3570,7 +3570,7 @@ function wfGetLB( $wiki = false ) {
  *
  * @return LBFactory
  */
-function &wfGetLBFactory() {
+function wfGetLBFactory() {
        return LBFactory::singleton();
 }