r80469 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80468‎ | r80469 | r80470 >
Date:21:50, 17 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
escaping fix
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -67,17 +67,15 @@
6868 if ( $page_name != '' ) {
6969 // Append the namespace prefix to the page name,
7070 // if this namespace was not already entered.
71 - if ( strpos( $page_name, $target_namespace . ":" ) === false && $target_namespace != '' )
72 - $page_name = $target_namespace . ":" . $page_name;
 71+ if ( strpos( $page_name, $target_namespace . ':' ) === false && $target_namespace != '' )
 72+ $page_name = $target_namespace . ':' . $page_name;
7373 // find out whether this page already exists,
7474 // and send user to the appropriate form
7575 $page_title = Title::newFromText( $page_name );
7676 if ( ! $page_title ) {
77 - // if there was no page title, it's
78 - // probably an invalid page name,
79 - // containing forbidden characters
80 - $error_msg = wfMsg( 'sf_formstart_badtitle', htmlspecialchars( $page_name ) );
81 - $wgOut->addHTML( $error_msg );
 77+ //If there was no page title, it's probably an invalid page name,
 78+ // containing forbidden characters.
 79+ $wgOut->addHTML( htmlspecialchars( wfMsg( 'sf_formstart_badtitle', $page_name ) ) );
8280 return;
8381 } else {
8482 SFFormStart::doRedirect( $form_name, $page_name, $params );
@@ -87,13 +85,16 @@
8886 }
8987
9088 if ( ( ! $form_title || ! $form_title->exists() ) && ( $form_name != '' ) ) {
91 - $text = '<p>' . wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) . ".</p>\n";
 89+ $text = '<p>' . htmlspecialchars( wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . ".</p>\n";
9290 } else {
93 - if ( $form_name == '' )
94 - $description = wfMsg( 'sf_formstart_noform_docu', $form_name );
95 - else
96 - $description = wfMsg( 'sf_formstart_docu', $form_name );
97 - $button_text = wfMsg( 'sf_formstart_createoredit' );
 91+ if ( $form_name == '' ) {
 92+ $description = htmlspecialchars( wfMsg( 'sf_formstart_noform_docu', $form_name ) );
 93+ }
 94+ else {
 95+ $description = htmlspecialchars( wfMsg( 'sf_formstart_docu', $form_name ) );
 96+ }
 97+
 98+ $button_text = htmlspecialchars( wfMsg( 'sf_formstart_createoredit' ) );
9899 $text = <<<END
99100 <form action="" method="post">
100101 <p>$description</p>