(Bug 17970) {{PROTECTIONLEVEL}} should be able to return the status for pages besides...
[lhc/web/wiklou.git] / includes / Xml.php
index 2f8ba0f..d5e9189 100644 (file)
@@ -576,7 +576,8 @@ class Xml {
         */
        public static function textarea( $name, $content, $cols = 40, $rows = 5, $attribs = array() ) {
                return self::element( 'textarea',
-                                       array(  'name' => $name,
+                                       array(
+                                               'name' => $name,
                                                'id' => $name,
                                                'cols' => $cols,
                                                'rows' => $rows
@@ -681,22 +682,11 @@ class Xml {
         * @return string
         */
        public static function encodeJsCall( $name, $args ) {
-               $s = "$name(";
-               $first = true;
-
-               foreach ( $args as $arg ) {
-                       if ( $first ) {
-                               $first = false;
-                       } else {
-                               $s .= ', ';
-                       }
-
-                       $s .= Xml::encodeJsVar( $arg );
+               foreach ( $args as &$arg ) {
+                       $arg = Xml::encodeJsVar( $arg );
                }
 
-               $s .= ");\n";
-
-               return $s;
+               return "$name(" . implode( ', ', $args ) . ");\n";
        }
 
        /**