* Tags that must be closed. (list copied from Sanitizer.php)
*/
public $tags = '/<\/?(b|del|i|ins|u|font|big|small|sub|sup|h1|h2|h3|h4|h5|h6|cite|code|em|s|strike|strong|tt|tr|td|var|div|center|blockquote|ol|ul|dl|table|caption|pre|ruby|rt|rb|rp|p|span)([\s](.*?)>|>)/i';
/**
+ * Determine if the page has html type things which make it
+ * potentially unsafe to do these types of regex replacements on.
+ * Most of MW does not output html that will match this.
+ */
+ const UNSAFE_ATTRIBS = '/<[^><]*</';
+
+ protected $logger;
+
+ public function setLogger( LoggerInterface $logger ) {
- "doublewiki-desc": "Displays a page and its translation from another wiki on two columns of the same page"
-}
\ No newline at end of file
+ "doublewiki-desc": "Displays a page and its translation from another wiki on two columns of the same page",
+ "doublewiki-unsafeattribute": "Cannot show DoubleWiki match for this page due to an HTML attribute containing an unescaped < on [[:$1]]",
+ "doublewiki-translationfullhtml": "Cannot show DoubleWiki, since the page [[:$1]] appears to be a full HTML document and not a wiki page",
+ "doublewiki-cannotfetchself": "Cannot show DoubleWiki since the current page cannot be fetched. Check that the wiki is network accessible to itself."
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index dcb8abf..b466d6b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -4,5 +4,8 @@
"Raymond"
]
},
- "doublewiki-desc": "Extension description displayed on [[Special:Version]]"
+ "doublewiki-desc": "Extension description displayed on [[Special:Version]]",
+ "doublewiki-unsafeattribute": "Shown if DoubleWiki is disabled due to suspicious html in either the current page or the page being compared against. $1 - Page name with the unsafe html, possibly including an interlanguage prefix.",
+ "doublewiki-translationfullhtml": "Shown if the page being compared does not appear to be a wikipage. For example if the page being compared against is a special page, this error will be shown. $1 Name of page being compared, including interwiki prefix (e.g. 'de:Special:BlankPage')",
+ "doublewiki-cannotfetchself": "{{optional}} Shown if the current page is inaccessible over HTTP. Since it is very unlikely for this error to happen, it is probably optional to translate it."