X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=4cc4f005eb3c4fbdd123cd2d87d4a318949d89d7;hb=59b627b0b7ad87317601f676a1ebd2441f63f59d;hp=243df9282726c2812fcac2cf60514bad4fb9f5b9;hpb=bacc11eb30ddf01624d5448f432b96afdae67c28;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 243df92827..4cc4f005eb 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1985,8 +1985,11 @@ function wfGetAllCallers( $limit = 3 ) { * @return string */ function wfFormatStackFrame( $frame ) { - return isset( $frame['class'] ) ? - $frame['class'] . '::' . $frame['function'] : + if ( !isset( $frame['function'] ) ) { + return 'NO_FUNCTION_GIVEN'; + } + return isset( $frame['class'] ) && isset( $frame['type'] ) ? + $frame['class'] . $frame['type'] . $frame['function'] : $frame['function']; } @@ -2856,16 +2859,17 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(), $status = false; $logMsg = false; - // According to the documentation, it is possible for stream_select() - // to fail due to EINTR. I haven't managed to induce this in testing - // despite sending various signals. If it did happen, the error - // message would take the form: - // - // stream_select(): unable to select [4]: Interrupted system call (max_fd=5) - // - // where [4] is the value of the macro EINTR and "Interrupted system - // call" is string which according to the Linux manual is "possibly" - // localised according to LC_MESSAGES. + /* According to the documentation, it is possible for stream_select() + * to fail due to EINTR. I haven't managed to induce this in testing + * despite sending various signals. If it did happen, the error + * message would take the form: + * + * stream_select(): unable to select [4]: Interrupted system call (max_fd=5) + * + * where [4] is the value of the macro EINTR and "Interrupted system + * call" is string which according to the Linux manual is "possibly" + * localised according to LC_MESSAGES. + */ $eintr = defined( 'SOCKET_EINTR' ) ? SOCKET_EINTR : 4; $eintrMessage = "stream_select(): unable to select [$eintr]"; @@ -3737,16 +3741,16 @@ function wfScript( $script = 'index' ) { */ function wfGetScriptUrl() { if ( isset( $_SERVER['SCRIPT_NAME'] ) ) { - # - # as it was called, minus the query string. - # - # Some sites use Apache rewrite rules to handle subdomains, - # and have PHP set up in a weird way that causes PHP_SELF - # to contain the rewritten URL instead of the one that the - # outside world sees. - # - # If in this mode, use SCRIPT_URL instead, which mod_rewrite - # provides containing the "before" URL. + /* as it was called, minus the query string. + * + * Some sites use Apache rewrite rules to handle subdomains, + * and have PHP set up in a weird way that causes PHP_SELF + * to contain the rewritten URL instead of the one that the + * outside world sees. + * + * If in this mode, use SCRIPT_URL instead, which mod_rewrite + * provides containing the "before" URL. + */ return $_SERVER['SCRIPT_NAME']; } else { return $_SERVER['URL']; @@ -3936,12 +3940,13 @@ function wfTransactionalTimeLimit() { * Converts shorthand byte notation to integer form * * @param string $string + * @param int $default Returned if $string is empty * @return int */ -function wfShorthandToInteger( $string = '' ) { +function wfShorthandToInteger( $string = '', $default = -1 ) { $string = trim( $string ); if ( $string === '' ) { - return -1; + return $default; } $last = $string[strlen( $string ) - 1]; $val = intval( $string );