From 241b1b9b00f7e6c1734b1beda7366c36bcfc85f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 8 Dec 2005 08:01:39 +0000 Subject: [PATCH] * Documentation: "Check where as the operating" => "Check if the operating system" * Code formatting * Make wfOpenElement() support attributes * Changed variable name: $x => $protocols --- includes/GlobalFunctions.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2515f395fa..45e1e0c8a4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1262,9 +1262,9 @@ function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) { } /** - * Check where as the operating system is Windows + * Check if the operating system is Windows * - * @return bool True if it's windows, False otherwise. + * @return bool True if it's Windows, False otherwise. */ function wfIsWindows() { if (substr(php_uname(), 0, 7) == 'Windows') { @@ -1330,9 +1330,7 @@ function wfElement( $element, $attribs = null, $contents = '') { if( $contents == '' ) { $out .= ' />'; } else { - $out .= '>'; - $out .= htmlspecialchars( $contents ); - $out .= ""; + $out .= '>' . htmlspecialchars( $contents ) . ""; } } return $out; @@ -1359,7 +1357,7 @@ function wfElementClean( $element, $attribs = array(), $contents = '') { } // Shortcuts -function wfOpenElement( $element ) { return "<$element>"; } +function wfOpenElement( $element, $attribs = null ) { return wfElement( $element, $attribs, null ); } function wfCloseElement( $element ) { return ""; } /** @@ -1555,11 +1553,11 @@ function in_string( $needle, $str ) { function wfUrlProtocols() { global $wgUrlProtocols; - $x = array(); + $protocols = array(); foreach ($wgUrlProtocols as $protocol) - $x[] = preg_quote( $protocol, '/' ); + $protocols[] = preg_quote( $protocol, '/' ); - return implode( '|', $x ); + return implode( '|', $protocols ); } /** -- 2.20.1