r79161 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79160‎ | r79161 | r79162 >
Date:03:58, 29 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fixed parsing of "page name=" parameter to finally handle parser function calls that contain pipes
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -75,13 +75,9 @@
7676 $form_definition = $form_article->getContent();
7777 $form_definition = StringUtils::delimiterReplace( '<noinclude>', '</noinclude>', '', $form_definition );
7878 $matches;
79 - if ( preg_match( '/{{{info.*page name\s*=\s*([^\|]*)/m', $form_definition, $matches ) ) {
80 - $page_name_formula = str_replace( '_', ' ', $matches[1] );
81 - // if the tag close ('}}}') is in here, chop off
82 - // that and everything after it
83 - if ( $pos = strpos( $page_name_formula, '}}}' ) ) {
84 - $page_name_formula = substr( $page_name_formula, 0, $pos );
85 - }
 79+ if ( preg_match( '/{{{info.*page name\s*=\s*(.*)}}}/m', $form_definition, $matches ) ) {
 80+ $page_name_elements = SFUtils::getFormTagComponents( $matches[1] );
 81+ $page_name_formula = $page_name_elements[0];
8682 } elseif ( count( $alt_forms ) == 0 ) {
8783 $wgOut->addHTML( Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) );
8884 return;

Status & tagging log