Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/224070

Change subject: Added escaping of many i18n messages
......................................................................

Added escaping of many i18n messages

Change-Id: Ifcb4504141f35b75040d860dcf60bf73caa38116
---
M includes/SF_FormEditAction.php
M includes/SF_FormField.php
M includes/SF_PageSection.php
M specials/SF_CreateCategory.php
M specials/SF_CreateForm.php
M specials/SF_CreateTemplate.php
6 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/70/224070/1

diff --git a/includes/SF_FormEditAction.php b/includes/SF_FormEditAction.php
index daf688e..6f42b1b 100644
--- a/includes/SF_FormEditAction.php
+++ b/includes/SF_FormEditAction.php
@@ -173,7 +173,7 @@
 
                // We need to call linkKnown(), not link(), so that SF's
                // edit=>formedit hook won't be called on this link.
-               $noFormLink = Linker::linkKnown( $title, wfMessage( 
'sf-formedit-donotuseform' )->text(), array(), array( 'action' => 'edit', 
'redlink' => true ) );
+               $noFormLink = Linker::linkKnown( $title, wfMessage( 
'sf-formedit-donotuseform' )->escaped(), array(), array( 'action' => 'edit', 
'redlink' => true ) );
                $output->addHTML( Html::rawElement( 'p', null, $noFormLink ) );
        }
 
diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 12d8114..bb521aa 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -209,7 +209,7 @@
                        $text .= Html::rawElement( 'p', null, wfMessage( 
$propDisplayMsg, $prop_link_text, $propertyTypeStr )->parse() ) . "\n";
                }
                // If it's not a semantic field - don't add any text.
-               $form_label_text = wfMessage( 'sf_createform_formlabel' 
)->text();
+               $form_label_text = wfMessage( 'sf_createform_formlabel' 
)->escaped();
                $form_label_input = Html::input(
                        'label_' . $field_form_text,
                        $template_field->getLabel(),
diff --git a/includes/SF_PageSection.php b/includes/SF_PageSection.php
index c610c17..f7773fd 100644
--- a/includes/SF_PageSection.php
+++ b/includes/SF_PageSection.php
@@ -73,7 +73,7 @@
                }
 
                $header_options =  '';
-               $text .= Html::rawElement( 'span', null, wfMessage( 
'sf_createform_sectionlevel' )->text() ) . "\n";
+               $text .= Html::element( 'span', null, wfMessage( 
'sf_createform_sectionlevel' )->text() ) . "\n";
                for ( $i = 1; $i < 7; $i++ ) {
                        if ( $section_level == $i ) {
                                $header_options .= " " . Html::element( 
'option', array( 'value' => $i, 'selected' ), $i ) . "\n";
diff --git a/specials/SF_CreateCategory.php b/specials/SF_CreateCategory.php
index 9f9d84a..25ca993 100644
--- a/specials/SF_CreateCategory.php
+++ b/specials/SF_CreateCategory.php
@@ -88,7 +88,7 @@
                $firstRow = '';
                if ( is_null( $presetCategoryName ) ) {
                        $text .= "\t" . Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) . "\n";
-                       $firstRow .= wfMessage( 'sf_createcategory_name' 
)->text() . ' ' .
+                       $firstRow .= wfMessage( 'sf_createcategory_name' 
)->escaped() . ' ' .
                                Html::input( 'category_name', null, 'text',
                                        array( 'size' => 25 ) ) . "\n";
                        if ( !is_null( $category_name_error_str ) ) {
@@ -97,7 +97,7 @@
                                        $category_name_error_str ) . "\n";
                        }
                }
-               $firstRow .= "\t" . wfMessage( 'sf_createcategory_defaultform' 
)->text() . "\n";
+               $firstRow .= "\t" . wfMessage( 'sf_createcategory_defaultform' 
)->escaped() . "\n";
                $formSelector = "\t" . Html::element( 'option', null, null ). 
"\n";
                foreach ( $all_forms as $form ) {
                        $formSelector .= "\t" . Html::element( 'option', null, 
$form ) . "\n";
@@ -107,7 +107,7 @@
                        array( 'id' => 'form_dropdown', 'name' => 
'default_form' ),
                        $formSelector );
                $text .= Html::rawElement( 'p', null, $firstRow )  . "\n";
-               $secondRow = wfMessage( 'sf_createcategory_makesubcategory' 
)->text() . ' ';
+               $secondRow = wfMessage( 'sf_createcategory_makesubcategory' 
)->escaped() . ' ';
                $selectBody = "\t" . Html::element( 'option', null, null ). 
"\n";
                $categories = SFUtils::getCategoriesForPage();
                foreach ( $categories as $category ) {
diff --git a/specials/SF_CreateForm.php b/specials/SF_CreateForm.php
index ac6479d..5ab1734 100644
--- a/specials/SF_CreateForm.php
+++ b/specials/SF_CreateForm.php
@@ -356,7 +356,7 @@
                $text .= "\t" . Html::input( 'add_field', $add_button_text, 
'submit' ) . "\n";
 
                // The form HTML for page sections
-               $text .= "</br></br>" . Html::rawElement( 'span', null, 
wfMessage( 'sf_createform_addsection' )->text() . ":" ) . "\n";
+               $text .= "</br></br>" . Html::element( 'span', null, wfMessage( 
'sf_createform_addsection' )->text() . ":" ) . "\n";
                $text .= Html::input( 'sectionname', '', 'text', array( 'size' 
=> '30', 'placeholder' => wfMessage( 'sf_createform_sectionname' )->text(), 
'id' => 'sectionname' ) ) . "\n";
 
                // Selection for before which item this section should be placed
diff --git a/specials/SF_CreateTemplate.php b/specials/SF_CreateTemplate.php
index a3c0b49..228100e 100644
--- a/specials/SF_CreateTemplate.php
+++ b/specials/SF_CreateTemplate.php
@@ -96,24 +96,24 @@
                $fieldString = $display ? '' : 'id="starterField" 
style="display: none"';
                $text = "\t<div class=\"fieldBox\" $fieldString>\n";
                $text .= "\t<table style=\"width: 100%;\"><tr><td>\n";
-               $text .= "\t<p><label>" . wfMessage( 
'sf_createtemplate_fieldname' )->text() . ' ' .
+               $text .= "\t<p><label>" . wfMessage( 
'sf_createtemplate_fieldname' )->escaped() . ' ' .
                        Html::input( 'name_' . $id, null, 'text',
                                array( 'size' => '15' )
                        ) . "</label>&nbsp;&nbsp;&nbsp;\n";
-               $text .= "\t<label>" . wfMessage( 
'sf_createtemplate_displaylabel' )->text() . ' ' .
+               $text .= "\t<label>" . wfMessage( 
'sf_createtemplate_displaylabel' )->escaped() . ' ' .
                        Html::input( 'label_' . $id, null, 'text',
                                array( 'size' => '15' )
                        ) . "</label>&nbsp;&nbsp;&nbsp;\n";
 
                if ( defined( 'SMW_VERSION' ) ) {
                        $dropdown_html = self::printPropertiesComboBox( 
$all_properties, $id );
-                       $text .= "\t<label>" . wfMessage( 
'sf_createtemplate_semanticproperty' )->text() . ' ' . $dropdown_html . 
"</label></p>\n";
+                       $text .= "\t<label>" . wfMessage( 
'sf_createtemplate_semanticproperty' )->escaped() . ' ' . $dropdown_html . 
"</label></p>\n";
                } elseif ( defined( 'CARGO_VERSION' ) ) {
                        $dropdown_html = self::printFieldTypeDropdown( $id );
                        $text .= "\t<label>" . wfMessage( 
'sf_createproperty_proptype' )->text() . ' ' . $dropdown_html . 
"</label></p>\n";
                }
 
-               $text .= "\t<p>" . '<label><input type="checkbox" 
name="is_list_' . $id . '" class="isList" /> ' . wfMessage( 
'sf_createtemplate_fieldislist' )->text() . "</label>&nbsp;&nbsp;&nbsp;\n";
+               $text .= "\t<p>" . '<label><input type="checkbox" 
name="is_list_' . $id . '" class="isList" /> ' . wfMessage( 
'sf_createtemplate_fieldislist' )->escaped() . "</label>&nbsp;&nbsp;&nbsp;\n";
                $text .= "\t" . '<label class="delimiter" style="display: 
none;">' . wfMessage( 'sf_createtemplate_delimiter' )->text() . ' ' .
                        Html::input( 'delimiter_' . $id, ',', 'text',
                                array( 'size' => '2' )
@@ -127,7 +127,7 @@
                        $text .= "\t</p>\n";
                }
                $text .= "\t</td><td>\n";
-               $text .= "\t" . '<input type="button" value="' . wfMessage( 
'sf_createtemplate_deletefield' )->text() . '" class="deleteField" />' . "\n";
+               $text .= "\t" . '<input type="button" value="' . wfMessage( 
'sf_createtemplate_deletefield' )->escaped() . '" class="deleteField" />' . 
"\n";
 
                $text .= <<<END
 </td></tr></table>

-- 
To view, visit https://gerrit.wikimedia.org/r/224070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcb4504141f35b75040d860dcf60bf73caa38116
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to