
ialex at svn
Jun 27, 2008, 4:01 AM
Post #1 of 1
(126 views)
Permalink
|
|
SVN: [36724] trunk/phase3/includes/Xml.php
|
|
Revision: 36724 Author: ialex Date: 2008-06-27 11:01:04 +0000 (Fri, 27 Jun 2008) Log Message: ----------- Don't allow contentless tags for <textarea> Modified Paths: -------------- trunk/phase3/includes/Xml.php Modified: trunk/phase3/includes/Xml.php =================================================================== --- trunk/phase3/includes/Xml.php 2008-06-27 10:47:01 UTC (rev 36723) +++ trunk/phase3/includes/Xml.php 2008-06-27 11:01:04 UTC (rev 36724) @@ -14,9 +14,10 @@ * @param $element String: element name * @param $attribs Array: Name=>value pairs. Values will be escaped. * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default) + * @param $allowShortTag Bool: whether '' in $contents will result in a contentless closed tag * @return string */ - public static function element( $element, $attribs = null, $contents = '') { + public static function element( $element, $attribs = null, $contents = '', $allowShortTag = true ) { $out = '<' . $element; if( !is_null( $attribs ) ) { $out .= self::expandAttributes( $attribs ); @@ -24,7 +25,7 @@ if( is_null( $contents ) ) { $out .= '>'; } else { - if( $contents === '' ) { + if( $allowShortTag && $contents === '' ) { $out .= ' />'; } else { $out .= '>' . htmlspecialchars( $contents ) . "</$element>"; @@ -489,7 +490,7 @@ 'cols' => $cols, 'rows' => $rows ) + $attribs, - $content."\n" ); + $content, false ); } /** _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS[at]lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
|