r33517 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33516‎ | r33517 | r33518 >
Date:19:56, 17 April 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Check for MW \xf7UNIQ-escapes in input values, throw generic error (added to language files) -- beyond that,
we cannot really handle this case properly in an obvious way. Closes Bug 13474.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Infolink.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageAr.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageDe.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEn.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEs.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageFr.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageHe.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageIt.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageKo.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageNl.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguagePl.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageRu.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageSk.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_cn.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_tw.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php
@@ -35,6 +35,7 @@
3636 wfProfileIn('SMWDataValue::setUserValue (SMW)');
3737 $this->m_errors = array(); // clear errors
3838 $this->m_infolinks = array(); // clear links
 39+ $this->m_isset = false;
3940 $this->m_hasssearchlink = false;
4041 $this->m_hasservicelinks = false;
4142 if ( is_string($caption) ) {
@@ -42,8 +43,16 @@
4344 } else {
4445 $this->m_caption = false;
4546 }
46 - $this->parseUserValue($value); // may set caption if not set yet, depending on datavalue
47 - $this->m_isset = true;
 47+ // The following checks for markers generated by MediaWiki to handle special content,
 48+ // e.g. math. In general, we are not prepared to handle such content properly, and we
 49+ // also have no means of obtaining the user input at this point. Hence the assignement
 50+ // just fails.
 51+ if (strpos($value,"\x7f") === false) {
 52+ $this->parseUserValue($value); // may set caption if not set yet, depending on datavalue
 53+ $this->m_isset = true;
 54+ } else {
 55+ $this->addError(wfMsgForContent('smw_parseerror'));
 56+ }
4857 if ($this->isValid()) {
4958 $this->checkAllowedValues();
5059 }
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Infolink.php
@@ -282,7 +282,7 @@
283283 * Obtain an array of parameters from the parameters given to some HTTP service.
284284 * In particular, this function perfoms all necessary decoding as may be needed, e.g.,
285285 * to recover the proper paramter strings after encoding for use in wiki title names
286 - * as done by SMWInfolink::encodeParameters().
 286+ * as done by SMWInfolink::encodeParameters().
287287 *
288288 * If $allparams is set to true, it is assumed that further data should be obtained
289289 * from the global $wgRequest, and all given parameters are read.
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_cn.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '$1无法用于名字空间为“$2"的页面。', //'$1 can not be used for pages in the namespace “$2".'
3535 'smw_no_importelement' => '无法导入“$1"元素', //'Element “$1" not available for import.'
3636 // Messages and strings for basic datatype processing
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => '.',
3839 'smw_kiloseparator' => ',',
3940 'smw_notitle' => '在此wiki内,是无法用“$1"来当作页面名称的', //'“$1" cannot be used as a page name in this wiki.'
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageAr.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '$1 can not be used for pages in the namespace “$2”.', // TODO: translate
3535 'smw_no_importelement' => ' غير متاح للاستيراد “$1” عنصر ',
3636 // Messages and strings for basic datatype processing
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => '.',
3839 'smw_kiloseparator' => ',',
3940 'smw_notitle' => '“$1” لا يمكن أن تستخدم مثل هذا الاسم في صفحة ويكي.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEn.php
@@ -35,6 +35,7 @@
3636 'smw_wrong_importtype' => '$1 can not be used for pages in the namespace “$2”.',
3737 'smw_no_importelement' => 'Element “$1” not available for import.',
3838 // Messages and strings for basic datatype processing
 39+ 'smw_parseerror' => 'The given value was not understood.', // generic error, "something" went wrong
3940 'smw_decseparator' => '.',
4041 'smw_kiloseparator' => ',',
4142 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageRu.php
@@ -34,6 +34,7 @@
3535 'smw_wrong_importtype' => 'Ошибка: $1 не может быть использован для статей с пространством имен "$2".',
3636 'smw_no_importelement' => 'Ошибка: Элемент "$1" не доступен для импорта.',
3737 // Messages and strings for basic datatype processing
 38+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3839 'smw_decseparator' => ',',
3940 'smw_kiloseparator' => ' ',
4041 'smw_notitle' => '“$1” не может быть использован как заголовок статьи на данном сайте.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEs.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => 'El elemento "$1" no puede ser utilizado para los artículos del espacio de nombres dominio "$2".',
3535 'smw_no_importelement' => 'El elemento "$1" no está disponible para la importación.',
3636 /*Messages and strings for basic datatype processing*/
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went wrong
3738 'smw_decseparator' => ',',
3839 'smw_kiloseparator' => '.',
3940 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.', // TODO Translate
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageFr.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => 'L\'élément "$1" ne peut être employé pour des articles de l\'espace de nommage domaine "$2".',
3535 'smw_no_importelement' => 'L\'élément "$1" n\'est pas disponible pour l\'importation.',
3636 /*Messages and strings for basic datatype processing*/
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => ',',
3839 'smw_kiloseparator' => '.',
3940 'smw_notitle' => '“$1” ne peut être utilisé comme nom de page sur ce wiki.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageDe.php
@@ -42,6 +42,7 @@
4343 'smw_wrong_importtype' => 'Das Element „$1“ kann nicht für Seiten im Namensraum „$2“ verwendet werden.',
4444 'smw_no_importelement' => 'Das Element „$1“ steht leider nicht zum Importieren zur Verfügung.',
4545 /*Messages and strings for basic datatype processing*/
 46+ 'smw_parseerror' => 'Der eingegebene Wert wurde nicht verstanden.', // generic error, "something" went wrong
4647 'smw_decseparator' => ',',
4748 'smw_kiloseparator' => '.',
4849 'smw_notitle' => '“$1” kann nicht als Seitenname in diesem Wiki verwendet werden.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageKo.php
@@ -36,6 +36,7 @@
3737 'smw_wrong_importtype' => '$1 페이지에 대해 사용할 수없습니다 네임 스페이스 “$2”.',
3838 'smw_no_importelement' => '원소 “$1” 에 사용할 수없습니다 져올.',
3939 // Messages and strings for basic datatype processing
 40+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
4041 'smw_decseparator' => '.',
4142 'smw_kiloseparator' => ',',
4243 'smw_notitle' => '“$1” 대한 이름으로 사용하실 수없습니다이 위키는 페이지입니다.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageNl.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '$1 kan niet gebruikt worden in pagina\'s in de naamruimte “$2”.',
3535 'smw_no_importelement' => 'Element “$1” is niet beschikbaar voor import.',
3636 // Messages and strings for basic datatype processing
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => ',',
3839 'smw_kiloseparator' => '.',
3940 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.', // TODO Translate
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguagePl.php
@@ -52,6 +52,7 @@
5353 'smw_wrong_importtype' => '$1 nie może być użyte dla artykułów z przestrzeni nazw "$2".',
5454 'smw_no_importelement' => 'Nie można zaimportować elementu "$1".',
5555 /*Messages and strings for basic datatype processing*/
 56+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
5657 'smw_decseparator' => ',',
5758 'smw_kiloseparator' => '.',
5859 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.', // TODO Translate
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_tw.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '$1無法用於名字空間為“$2”的頁面。', //'$1 can not be used for pages in the namespace “$2”.'
3535 'smw_no_importelement' => '無法匯入“$1”元素', //'Element “$1” not available for import.'
3636 // Messages and strings for basic datatype processing
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => '.',
3839 'smw_kiloseparator' => ',',
3940 'smw_notitle' => '在此wiki內,是無法用“$1”來當作頁面名稱的', //'“$1” cannot be used as a page name in this wiki.'
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageHe.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '[Sorry, $1 can not be used for pages in the namespace "$2"]',
3535 'smw_no_importelement' => '[Sorry, element "$1" not available for import.]',
3636 /*Messages and strings for basic datatype processing*/
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => '.',
3839 'smw_kiloseparator' => ',',
3940 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.', // TODO Translate
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageIt.php
@@ -33,6 +33,7 @@
3434 'smw_wrong_importtype' => '$1 non può essere utilizzate per pagine nel namespace “$2”.',
3535 'smw_no_importelement' => 'L\'elemento “$1” non è disponibile per l\'importazione.',
3636 // Messages and strings for basic datatype processing
 37+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3738 'smw_decseparator' => '.',
3839 'smw_kiloseparator' => ',',
3940 'smw_notitle' => '“$1” non può essere utilizzato come nome di una pagina all\'interno di questo wiki.',
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageSk.php
@@ -34,6 +34,7 @@
3535 'smw_wrong_importtype' => '$1 nie je možné použiť pre stránky z menného priestoru "$2".',
3636 'smw_no_importelement' => 'Prvok "$1" nie je dostupný na import.',
3737 /*Messages and strings for basic datatype processing*/
 38+ 'smw_parseerror' => 'The given value was not understood.', // TODO: translate; generic error, "something" went
3839 'smw_decseparator' => '.',
3940 'smw_kiloseparator' => ',',
4041 'smw_notitle' => '“$1” cannot be used as a page name in this wiki.', // TODO Translate

Status & tagging log