https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102049
Revision: 102049
Author: foxtrott
Date: 2011-11-04 21:16:24 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
followup 102038: finer-grained escaping
Modified Paths:
--------------
trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
Modified: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
2011-11-04 21:16:20 UTC (rev 102048)
+++ trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
2011-11-04 21:16:24 UTC (rev 102049)
@@ -235,13 +235,21 @@
}
}
if ( $inLinkType == 'button' ) {
- $str = "<form action=\"$link_url\" method=\"get\"
class=\"$classStr\">";
- $str .= Xml::tags( 'button', array( 'type' => 'submit',
'value' => $inLinkStr ), $inLinkStr );
- $str .= "$hidden_inputs</form>";
+ $str =
+ Xml::openElement( 'form', array('action' =>
$link_url, 'method' => 'get', 'class' => $classStr) ) .
+ Xml::openElement( 'button', array('type' =>
'submit', 'value' => $inLinkStr) ) .
+ $inLinkStr .
+ Xml::closeElement( 'button' ) .
+ $hidden_inputs .
+ Xml::closeElement( 'form' );
} elseif ( $inLinkType == 'post button' ) {
- $str = "<form action=\"$link_url\" method=\"post\"
class=\"$classStr\">";
- $str .= Xml::tags( 'button', array( 'type' => 'submit',
'value' => $inLinkStr ), $inLinkStr );
- $str .= "$hidden_inputs</form>";
+ $str =
+ Xml::openElement( 'form', array('action' =>
$link_url, 'method' => 'post', 'class' => $classStr) ) .
+ Xml::openElement( 'button', array('type' =>
'submit', 'value' => $inLinkStr) ) .
+ $inLinkStr .
+ Xml::closeElement( 'button' ) .
+ $hidden_inputs .
+ Xml::closeElement( 'form' );
} else {
// If a target page has been specified but it doesn't
// exist, make it a red link.
@@ -251,7 +259,10 @@
$classStr .= " new";
}
}
- $str = Xml::tags( 'a', array( 'href' => $link_url,
'class' => $classStr, 'title' => $inTitle ), $inLinkStr );
+ $str =
+ Xml::openElement( 'a', array('href' =>
$link_url, 'class' => $classStr, 'title' => $inTitle) ) .
+ $inLinkStr .
+ Xml::closeElement( 'a' );
}
// hack to remove newline from beginning of output, thanks to
//
http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs