From 0068c3553b849789f63e143eb15aa82d02890b47 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 28 Jul 2005 16:50:26 +0000 Subject: [PATCH 01/16] fixed discussion namespace --- languages/LanguageAst.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/LanguageAst.php b/languages/LanguageAst.php index a08a822747..0f5f4413bd 100644 --- a/languages/LanguageAst.php +++ b/languages/LanguageAst.php @@ -22,7 +22,7 @@ if($wgMetaNamespace === FALSE) NS_USER => 'Usuariu', NS_USER_TALK => 'Usuariu_discusión', NS_PROJECT => $wgMetaNamespace, - NS_PROJECT_TALK => $wgMetaNamespace . 'discusión', + NS_PROJECT_TALK => $wgMetaNamespace ._ 'discusión', NS_IMAGE => 'Imaxen', NS_IMAGE_TALK => 'Imaxen_discusión', NS_MEDIAWIKI => 'MediaWiki', -- 2.20.1 From b74176400a2f70a2ca63bf0d108dc5c87923e1d9 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 28 Jul 2005 16:52:25 +0000 Subject: [PATCH 02/16] fixed discussion namespace - again --- languages/LanguageAst.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/LanguageAst.php b/languages/LanguageAst.php index 0f5f4413bd..6e7645ced1 100644 --- a/languages/LanguageAst.php +++ b/languages/LanguageAst.php @@ -22,7 +22,7 @@ if($wgMetaNamespace === FALSE) NS_USER => 'Usuariu', NS_USER_TALK => 'Usuariu_discusión', NS_PROJECT => $wgMetaNamespace, - NS_PROJECT_TALK => $wgMetaNamespace ._ 'discusión', + NS_PROJECT_TALK => $wgMetaNamespace . '_discusión', NS_IMAGE => 'Imaxen', NS_IMAGE_TALK => 'Imaxen_discusión', NS_MEDIAWIKI => 'MediaWiki', -- 2.20.1 From 0f3eb80d98d96d4eaaba0a519b3af797fb153b03 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 05:44:49 +0000 Subject: [PATCH 03/16] after going to 'next' and then 'previous', the very latest edit would not be displayed. --- includes/SpecialContributions.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 5e5e1fa0d0..0dda760f5a 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -22,20 +22,27 @@ class contribs_finder { $this->offset = $offset; } - function get_edit_limits() { + function get_edit_limit($dir) { list($index, $usercond) = $this->get_user_cond(); $use_index = $this->dbr->useIndexClause($index); extract($this->dbr->tableNames('revision')); - $sql = "SELECT MIN(rev_timestamp) as earliest, MAX(rev_timestamp) as latest " . - "FROM $revision $use_index WHERE " . $usercond; + $sql = "SELECT rev_timestamp " . + " FROM $revision $use_index " . + " WHERE " . $usercond . + " ORDER BY rev_timestamp $dir LIMIT 1"; - $res = $this->dbr->query($sql, "contribs_finder::get_edit_limits"); - $rows = array(); + $res = $this->dbr->query($sql, "contribs_finder::get_edit_limit"); while ($o = $this->dbr->fetchObject($res)) - $rows[] = $o; - $row = $rows[count($rows) - 1]; - return array($row->earliest, $row->latest); + $row = $o; + return $row->rev_timestamp; + } + + function get_edit_limits() { + return array( + $this->get_edit_limit("ASC"), + $this->get_edit_limit("DESC") + ); } function get_user_cond() { @@ -65,7 +72,7 @@ class contribs_finder { $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " . "WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " . "rev_user_text = " . $this->dbr->addQuotes($this->username); - $sql .= " ORDER BY rev_timestamp ASC LIMIT " . $this->limit; + $sql .= " ORDER BY rev_timestamp ASC LIMIT " . ($this->limit+1); $res = $this->dbr->query($sql); $rows = array(); while ($obj = $this->dbr->fetchObject($res)) @@ -99,7 +106,7 @@ class contribs_finder { $limitQuery = "LIMIT {$this->limit}"; if ($this->offset) - $offsetQuery = "AND rev_timestamp < '{$this->offset}'"; + $offsetQuery = "AND rev_timestamp <= '{$this->offset}'"; $use_index = $this->dbr->useIndexClause($index); $sql = "SELECT -- 2.20.1 From 9a16c8035ad7d437d325f2e719a2e3e7340af1f8 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 05:51:25 +0000 Subject: [PATCH 04/16] Special:Contributions/newbies was broken --- includes/SpecialContributions.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 0dda760f5a..3a5c90e1ae 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -26,9 +26,9 @@ class contribs_finder { list($index, $usercond) = $this->get_user_cond(); $use_index = $this->dbr->useIndexClause($index); - extract($this->dbr->tableNames('revision')); + extract($this->dbr->tableNames('revision', 'page')); $sql = "SELECT rev_timestamp " . - " FROM $revision $use_index " . + " FROM $page,$revision $use_index " . " WHERE " . $usercond . " ORDER BY rev_timestamp $dir LIMIT 1"; @@ -50,7 +50,7 @@ class contribs_finder { if ($this->username == 'newbies') { $max = $this->dbr->selectField('user', 'max(user_id)', false, "make_sql"); - $condition = '>' . ($max - $max / 100); + $condition = '>' . (int)($max - $max / 100); } if ($condition == "") { @@ -60,7 +60,6 @@ class contribs_finder { $condition = " rev_user {$condition}"; $index = 'user_timestamp'; } - return array($index, $condition); } @@ -163,7 +162,7 @@ function wfSpecialContributions( $par = null ) { $urlbits = "target=" . wfUrlEncode($target); $myurl = $title->escapeLocalURL($urlbits); - $finder = new contribs_finder($nt->getText()); + $finder = new contribs_finder(($target == 'newbies') ? 'newbies' : $nt->getText()); $finder->set_limit($limit); $finder->set_offset($offset); -- 2.20.1 From caa0e6c973643dd6422958199560e9025fa3d46d Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 06:02:07 +0000 Subject: [PATCH 05/16] don't join page to revision without a join condition... --- includes/SpecialContributions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 3a5c90e1ae..99a4dfa2d6 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -28,7 +28,7 @@ class contribs_finder { $use_index = $this->dbr->useIndexClause($index); extract($this->dbr->tableNames('revision', 'page')); $sql = "SELECT rev_timestamp " . - " FROM $page,$revision $use_index " . + " FROM $revision $use_index " . " WHERE " . $usercond . " ORDER BY rev_timestamp $dir LIMIT 1"; -- 2.20.1 From 3c7916c8e08d97455a98bebff456227d683e881d Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 06:12:04 +0000 Subject: [PATCH 06/16] add namespace filtering without UI so i can it on the live situ --- includes/SpecialContributions.php | 35 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 99a4dfa2d6..484714fde4 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -6,14 +6,19 @@ /** @package MediaWiki */ class contribs_finder { - var $username, $offset, $limit; + var $username, $offset, $limit, $namespace; var $dbr; function contribs_finder($username) { $this->username = $username; + $this->namespace = false; $this->dbr =& wfGetDB(DB_SLAVE); } + function set_namespace($ns) { + $this->namespace = $ns; + } + function set_limit($limit) { $this->limit = $limit; } @@ -24,12 +29,12 @@ class contribs_finder { function get_edit_limit($dir) { list($index, $usercond) = $this->get_user_cond(); - + $nscond = $this->get_namespace_cond(); $use_index = $this->dbr->useIndexClause($index); extract($this->dbr->tableNames('revision', 'page')); $sql = "SELECT rev_timestamp " . - " FROM $revision $use_index " . - " WHERE " . $usercond . + " FROM $page,$revision $use_index " . + " WHERE rev_page=page_id AND $usercond $nscond" . " ORDER BY rev_timestamp $dir LIMIT 1"; $res = $this->dbr->query($sql, "contribs_finder::get_edit_limit"); @@ -63,14 +68,23 @@ class contribs_finder { return array($index, $condition); } + function get_namespace_cond() { + if ($this->namespace !== false) + return " AND page_namespace = " . (int)$this->namespace; + return ""; + } + function get_previous_offset_for_paging() { list($index, $usercond) = $this->get_user_cond(); + $nscond = $this->get_namespace_cond(); + $use_index = $this->dbr->useIndexClause($index); extract($this->dbr->tableNames('page', 'revision')); $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " . "WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " . - "rev_user_text = " . $this->dbr->addQuotes($this->username); + "rev_user_text = " . $this->dbr->addQuotes($this->username) . + $nscond; $sql .= " ORDER BY rev_timestamp ASC LIMIT " . ($this->limit+1); $res = $this->dbr->query($sql); $rows = array(); @@ -84,10 +98,11 @@ class contribs_finder { list($index, $usercond) = $this->get_user_cond(); $use_index = $this->dbr->useIndexClause($index); extract($this->dbr->tableNames('page', 'revision')); - + $nscond = $this->get_namespace_cond(); $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " . "WHERE page_id = rev_page AND " . - "rev_user_text = " . $this->dbr->addQuotes($this->username); + "rev_user_text = " . $this->dbr->addQuotes($this->username) . + $nscond; $sql .= " ORDER BY rev_timestamp ASC LIMIT " . ($this->limit + 1); $res = $this->dbr->query($sql); $rows = array(); @@ -107,13 +122,14 @@ class contribs_finder { if ($this->offset) $offsetQuery = "AND rev_timestamp <= '{$this->offset}'"; + $nscond = $this->get_namespace_cond(); $use_index = $this->dbr->useIndexClause($index); $sql = "SELECT page_namespace,page_title,page_is_new,page_latest, rev_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user_text, rev_deleted FROM $page,$revision $use_index - WHERE page_id=rev_page AND $userCond $offsetQuery + WHERE page_id=rev_page AND $userCond $nscond $offsetQuery ORDER BY rev_timestamp DESC $limitQuery"; return $sql; } @@ -167,6 +183,9 @@ function wfSpecialContributions( $par = null ) { $finder->set_limit($limit); $finder->set_offset($offset); + if (($ns = $wgRequest->getVal('namespace', null)) !== null) + $finder->set_namespace($ns); + if ($wgRequest->getText('go') == "prev") { $prevts = $finder->get_previous_offset_for_paging(); $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit"); -- 2.20.1 From 9e70a05c318fd5174b2cab9c0ad09f8a30ef3fb8 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 06:36:09 +0000 Subject: [PATCH 07/16] add namespace filter --- includes/SpecialContributions.php | 62 ++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 484714fde4..ea66479e5a 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -152,7 +152,8 @@ class contribs_finder { * @param string $par (optional) user name of the user for which to show the contributions */ function wfSpecialContributions( $par = null ) { - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle; + global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle, + $wgScript; $fname = 'wfSpecialContributions'; $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); @@ -183,19 +184,23 @@ function wfSpecialContributions( $par = null ) { $finder->set_limit($limit); $finder->set_offset($offset); - if (($ns = $wgRequest->getVal('namespace', null)) !== null) + $nsurl = $xnsurl = ""; + if (($ns = $wgRequest->getVal('namespace', null)) !== null) { + $nsurl = "&namespace=$ns"; + $xnsurl = htmlspecialchars($nsurl); $finder->set_namespace($ns); + } if ($wgRequest->getText('go') == "prev") { $prevts = $finder->get_previous_offset_for_paging(); - $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit"); + $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit$nsurl"); $wgOut->redirect($prevurl); return; } if ($wgRequest->getText('go') == "first") { $prevts = $finder->get_first_offset_for_paging(); - $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit"); + $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit$nsurl"); $wgOut->redirect($prevurl); return; } @@ -221,6 +226,45 @@ function wfSpecialContributions( $par = null ) { $wgOut->setSubtitle( wfMsgHtml( 'contribsub', $ul ) ); + $arr = $wgContLang->getFormattedNamespaces(); + $nsform = "
\n"; + $nsform .= wfElement("input", array( + "name" => "title", + "type" => "hidden", + "value" => $wgTitle->getPrefixedText())); + $nsform .= wfElement("input", array( + "name" => "offset", + "type" => "hidden", + "value" => $offset)); + $nsform .= wfElement("input", array( + "name" => "limit", + "type" => "hidden", + "value" => $limit)); + $nsform .= wfElement("input", array( + "name" => "target", + "type" => "hidden", + "value" => $target)); + $nsform .= "

"; + $nsform .= htmlspecialchars(wfMsg('namespace')) . " \n"; + $nsform .= wfElement("input", array( + "type" => "submit", + "value" => wfMsg('allpagessubmit'))); + $nsform .= "

\n"; + + $wgOut->addHTML($nsform); + $contribsPage = Title::makeTitle( NS_SPECIAL, 'Contributions' ); $contribs = $finder->find(); @@ -244,8 +288,8 @@ function wfSpecialContributions( $par = null ) { $lastlink = $lasttext; $prevlink = $prevtext; } else { - $lastlink = "$lasttext"; - $prevlink = "$prevtext"; + $lastlink = "$lasttext"; + $prevlink = "$prevtext"; } $nexttext = wfMsg("nextn", $limit); @@ -253,14 +297,14 @@ function wfSpecialContributions( $par = null ) { $firstlink = $firsttext; $nextlink = $nexttext; } else { - $firstlink = "$firsttext"; - $nextlink = "$nexttext"; + $firstlink = "$firsttext"; + $nextlink = "$nexttext"; } $firstlast = "($lastlink | $firstlink)"; $urls = array(); foreach (array(20, 50, 100, 250, 500) as $num) - $urls[] = "".$wgLang->formatNum($num).""; + $urls[] = "".$wgLang->formatNum($num).""; $bits = implode($urls, ' | '); $prevnextbits = "$firstlast " . wfMsgHtml("viewprevnext", $prevlink, $nextlink, $bits); -- 2.20.1 From c7270b7ac38c6666f252d76216b417079979b291 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Fri, 29 Jul 2005 06:40:40 +0000 Subject: [PATCH 08/16] fix go=first --- includes/SpecialContributions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index ea66479e5a..35afe173ec 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -103,7 +103,7 @@ class contribs_finder { "WHERE page_id = rev_page AND " . "rev_user_text = " . $this->dbr->addQuotes($this->username) . $nscond; - $sql .= " ORDER BY rev_timestamp ASC LIMIT " . ($this->limit + 1); + $sql .= " ORDER BY rev_timestamp ASC LIMIT " . $this->limit; $res = $this->dbr->query($sql); $rows = array(); while ($obj = $this->dbr->fetchObject($res)) -- 2.20.1 From 10392e09834918b541435890efd4b7bccaf876e1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 29 Jul 2005 10:08:41 +0000 Subject: [PATCH 09/16] * (bug 2676) Apply a protective transformation on editing input/output for browsers that hit the Unicode blacklist. Patch by plugwash. --- RELEASE-NOTES | 2 + includes/EditPage.php | 128 +++++++++++++++++++++++++++++++++++++++-- languages/Language.php | 2 +- 3 files changed, 127 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e672e4d8f4..43e4bc38ce 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -614,6 +614,8 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * Fix typo in undefined array index access prevention * (bug 2947) Update namespaces for sr localization * (bug 2952) Added Asturian language file with translated namespaces +* (bug 2676) Apply a protective transformation on editing input/output + for browsers that hit the Unicode blacklist. Patch by plugwash. === Caveats === diff --git a/includes/EditPage.php b/includes/EditPage.php index 6304cef18a..2c9394f5ce 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -211,8 +211,8 @@ class EditPage { # These fields need to be checked for encoding. # Also remove trailing whitespace, but don't remove _initial_ # whitespace from the text boxes. This may be significant formatting. - $this->textbox1 = rtrim( $request->getText( 'wpTextbox1' ) ); - $this->textbox2 = rtrim( $request->getText( 'wpTextbox2' ) ); + $this->textbox1 = $this->safeUnicodeInput( $request, 'wpTextbox1' ); + $this->textbox2 = $this->safeUnicodeInput( $request, 'wpTextbox2' ); $this->mMetaData = rtrim( $request->getText( 'metadata' ) ); $this->summary = $request->getText( 'wpSummary' ); @@ -699,6 +699,9 @@ class EditPage { } else $metadata = "" ; + $safemodehtml = $this->checkUnicodeCompliantBrowser() + ? "" + : "\n"; $wgOut->addHTML( << {$metadata}
{$editsummary} {$checkboxhtml} +{$safemodehtml} addWikiText( '==' . wfMsg( "yourtext" ) . '==' ); $wgOut->addHTML( "" ); } @@ -1162,6 +1166,122 @@ END return '
' . $difftext . '
'; } + /** + * Filter an input field through a Unicode de-armoring process if it + * came from an old browser with known broken Unicode editing issues. + * + * @param WebRequest $request + * @param string $field + * @return string + * @access private + */ + function safeUnicodeInput( $request, $field ) { + $text = rtrim( $request->getText( $field ) ); + return $request->getBool( 'safemode' ) + ? $this->unmakesafe( $text ) + : $text; + } + + /** + * Filter an output field through a Unicode de-armoring process if it + * came from an old browser with known broken Unicode editing issues. + * + * @param string $text + * @return string + * @access private + */ + function safeUnicodeOutput( $text ) { + global $wgContLang; + $codedText = $wgContLang->recodeForEdit( $text ); + return $this->checkUnicodeCompliantBrowser() + ? $codedText + : $this->makesafe( $codedText ); + } + + /** + * A number of web browsers are known to corrupt non-ASCII characters + * in a UTF-8 text editing environment. To protect against this, + * detected browsers will be served an armored version of the text, + * with non-ASCII chars converted to numeric HTML character references. + * + * Preexisting such character references will have a 0 added to them + * to ensure that round-trips do not alter the original data. + * + * @param string $invalue + * @return string + * @access private + */ + function makesafe( $invalue ) { + // Armor existing references for reversability. + $invalue = strtr( $invalue, array( "&#x" => "�" ) ); + + $bytesleft = 0; + $result = ""; + $working = 0; + for( $i = 0; $i < strlen( $invalue ); $i++ ) { + $bytevalue = ord( $invalue{$i} ); + if( $bytevalue <= 0x7F ) { //0xxx xxxx + $result .= chr( $bytevalue ); + $bytesleft = 0; + } elseif( $bytevalue <= 0xBF ) { //10xx xxxx + $working = $working << 6; + $working += ($bytevalue & 0x3F); + $bytesleft--; + if( $bytesleft <= 0 ) { + $result .= "&#x" . strtoupper( dechex( $working ) ) . ";"; + } + } elseif( $bytevalue <= 0xDF ) { //110x xxxx + $working = $bytevalue & 0x1F; + $bytesleft = 1; + } elseif( $bytevalue <= 0xEF ) { //1110 xxxx + $working = $bytevalue & 0x0F; + $bytesleft = 2; + } else { //1111 0xxx + $working = $bytevalue & 0x07; + $bytesleft = 3; + } + } + return $result; + } + + /** + * Reverse the previously applied transliteration of non-ASCII characters + * back to UTF-8. Used to protect data from corruption by broken web browsers + * as listed in $wgBrowserBlackList. + * + * @param string $invalue + * @return string + * @access private + */ + function unmakesafe( $invalue ) { + $result = ""; + for( $i = 0; $i < strlen( $invalue ); $i++ ) { + if( ( substr( $invalue, $i, 3 ) == "&#x" ) && ( $invalue{$i+3} != '0' ) ) { + $i += 3; + $hexstring = ""; + do { + $hexstring .= $invalue{$i}; + $i++; + } while( ctype_xdigit( $invalue{$i} ) && ( $i < strlen( $invalue ) ) ); + + // Do some sanity checks. These aren't needed for reversability, + // but should help keep the breakage down if the editor + // breaks one of the entities whilst editing. + if ((substr($invalue,$i,1)==";") and (strlen($hexstring) <= 6)) { + $codepoint = hexdec($hexstring); + $result .= codepointToUtf8( $codepoint ); + } else { + $result .= "&#x" . $hexstring . substr( $invalue, $i, 1 ); + } + } else { + $result .= substr( $invalue, $i, 1 ); + } + } + // reverse the transform that we made for reversability reasons. + return strtr( $result, array( "�" => "&#x" ) ); + } + + } ?> diff --git a/languages/Language.php b/languages/Language.php index 53c2969164..4fe129bf73 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -730,7 +730,7 @@ You will have to merge your changes into the existing text. press \"Save page\".
", 'yourtext' => 'Your text', 'storedversion' => 'Stored version', -'nonunicodebrowser' => "WARNING: Your browser is not unicode compliant, please change it before editing an article.", +'nonunicodebrowser' => "WARNING: Your browser is not unicode compliant. A workaround is in place to allow you to safely edit articles: non-ASCII characters will appear in the edit box as hexadecimal codes.", 'editingold' => "WARNING: You are editing an out-of-date revision of this page. If you save it, any changes made since this revision will be lost.", -- 2.20.1 From a650cff4464978963e3e006124045035642cee6c Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Fri, 29 Jul 2005 15:08:57 +0000 Subject: [PATCH 10/16] lists hooks added in LogPage.php v1.34 by Avar. --- docs/hooks.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index ecf6ca1226..92fa0f44c4 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -299,6 +299,15 @@ $from: address of sending user $subject: subject of the mail $text: text of the mail +'LogPageValidTypes': action being logged. +$type: array of strings + +'LogPageLogName': name of the logging page(s). +$typeText: array of strings + +'LogPageLogHeader': strings used by wfMsg as a header. +$headerText: array of strings + 'TitleMoveComplete': after moving an article (title) $old: old title $nt: new title @@ -339,3 +348,5 @@ $article: article object watched 'CategoryPageView': before viewing a categorypage in CategoryPage::view $catpage: CategoryPage instance + +More hooks might not be available but undocumented. -- 2.20.1 From 1bcc712cf7e872005588e4e210010b8b2af49ff6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 30 Jul 2005 08:03:04 +0000 Subject: [PATCH 11/16] typo --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 2c9394f5ce..1bf5650be9 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1183,8 +1183,8 @@ END } /** - * Filter an output field through a Unicode de-armoring process if it - * came from an old browser with known broken Unicode editing issues. + * Filter an output field through a Unicode armoring process if it is + * going to an old browser with known broken Unicode editing issues. * * @param string $text * @return string -- 2.20.1 From fca9da350e9cf5060dcc545f771c9f39ed7d6537 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 30 Jul 2005 19:47:39 +0000 Subject: [PATCH 12/16] * (bug 2885, 2931) Problems with references in php 4.4 and 5.1 --- languages/Language.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/Language.php b/languages/Language.php index 4fe129bf73..01c5962867 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2666,7 +2666,7 @@ class Language { # Fill a MagicWord object with data from here function getMagic( &$mw ) { - $raw =& $this->getMagicWords(); + $raw = $this->getMagicWords(); if( !isset( $raw[$mw->mId] ) ) { # Fall back to English if local list is incomplete $raw =& Language::getMagicWords(); -- 2.20.1 From 3f026e7518d95048d512b71b5d9898a2df5d29d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 30 Jul 2005 20:03:38 +0000 Subject: [PATCH 13/16] * Making a linkprefix message that hold the link prefix previously hardcoded in the parser --- includes/Parser.php | 2 +- languages/Language.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index bd8c912f67..f7d32f5590 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1213,7 +1213,7 @@ class Parser if ( !$e1_img ) { $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD"; } # Match the end of a line for a word that's not followed by whitespace, # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched - static $e2 = '/^(.*?)([a-zA-Z\x80-\xff]+)$/sD'; + $e2 = wfMsgForContent( 'linkprefix' ); $useLinkPrefixExtension = $wgContLang->linkPrefixExtension(); diff --git a/languages/Language.php b/languages/Language.php index 01c5962867..cfb8ffe256 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -352,6 +352,7 @@ parent class in order maintain consistency across languages. 'linktrail' => '/^([a-z]+)(.*)$/sD', +'linkprefix' => '/^(.*?)([a-zA-Z\x80-\xff]+)$/sD', 'mainpage' => 'Main Page', 'mainpagetext' => 'Wiki software successfully installed.', "mainpagedocfooter" => "Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] -- 2.20.1 From 4ff3e21cdc42a44bf394ddaf09621625b586d3d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 30 Jul 2005 20:06:25 +0000 Subject: [PATCH 14/16] * linkprefix support --- languages/LanguageIs.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/languages/LanguageIs.php b/languages/LanguageIs.php index 0a1616dcf4..411a308086 100644 --- a/languages/LanguageIs.php +++ b/languages/LanguageIs.php @@ -69,6 +69,7 @@ $wgMagicWordsIs = array( $wgAllMessagesIs = array( 'linktrail' => '/^([áðéíóúýþæöa-z-–]+)(.*)$/sDu', +'linkprefix'=> '/^(.*?)([áÁðÐéÉíÍóÓúÚýÝþÞæÆöÖA-Za-z-–]+)$/sDu', '1movedto2' => "$1 færð á $2", '1movedto2_redir' => "$1 færð á $2 yfir tilvísun", @@ -833,6 +834,10 @@ class LanguageIs extends LanguageUtf8 { function formatNum( $number, $year = false ) { return $year ? $number : strtr($this->commafy($number), '.,', ',.' ); } + + function linkPrefixExtension() { + return true; + } } ?> -- 2.20.1 From d5fdef55226a176ae124aaa1896fea732ceefc03 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 30 Jul 2005 20:14:34 +0000 Subject: [PATCH 15/16] * (bug 2999) Fix encoding conversion of pl_title in upgrade1_5.php --- RELEASE-NOTES | 1 + maintenance/FiveUpgrade.inc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 43e4bc38ce..8b1df213f9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -616,6 +616,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * (bug 2952) Added Asturian language file with translated namespaces * (bug 2676) Apply a protective transformation on editing input/output for browsers that hit the Unicode blacklist. Patch by plugwash. +* (bug 2999) Fix encoding conversion of pl_title in upgrade1_5.php === Caveats === diff --git a/maintenance/FiveUpgrade.inc b/maintenance/FiveUpgrade.inc index 34a0929880..4c8fcbc797 100644 --- a/maintenance/FiveUpgrade.inc +++ b/maintenance/FiveUpgrade.inc @@ -537,9 +537,9 @@ CREATE TABLE $pagelinks ( $add = array(); while( $row = $this->dbr->fetchObject( $result ) ) { $add[] = array( - 'pl_from' => $row->l_from, - 'pl_namespace' => $row->cur_namespace, - 'pl_title' => $row->cur_title ); + 'pl_from' => $row->l_from, + 'pl_namespace' => $row->cur_namespace, + 'pl_title' => $this->conv( $row->cur_title ) ); $this->addChunk( $add ); } $this->lastChunk( $add ); -- 2.20.1 From 1814714ddb5d89d646eb26966d9f04efca2cdd41 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 30 Jul 2005 20:57:15 +0000 Subject: [PATCH 16/16] Bump to beta4; disable compressOld as it's known to break. --- RELEASE-NOTES | 9 +++++++++ includes/DefaultSettings.php | 2 +- maintenance/compressOld.php | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8b1df213f9..6e6c49236f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -3,6 +3,14 @@ Security reminder: MediaWiki does not require PHP's register_globals setting since version 1.2.0. If you have it on, turn it *off* if you can. +== MediaWiki 1.5 beta 4 == + +July 30, 2005 + +MediaWiki 1.5 beta 4 is a preview release of the new 1.5 release series. +A number of bugs have been fixed since beta 3; see the full changelist below. + + == MediaWiki 1.5 beta 3 == July 7, 2005 @@ -617,6 +625,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * (bug 2676) Apply a protective transformation on editing input/output for browsers that hit the Unicode blacklist. Patch by plugwash. * (bug 2999) Fix encoding conversion of pl_title in upgrade1_5.php +* compressOld.php disabled, as it's known to be broken. === Caveats === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9121bb0b5a..7690ddc86a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -28,7 +28,7 @@ require_once( 'includes/SiteConfiguration.php' ); $wgConf = new SiteConfiguration; /** MediaWiki version number */ -$wgVersion = '1.5beta3'; +$wgVersion = '1.5beta4'; /** Name of the site. It must be changed in LocalSettings.php */ $wgSitename = 'MediaWiki'; diff --git a/maintenance/compressOld.php b/maintenance/compressOld.php index 865fcebd9c..0d449c4c7c 100644 --- a/maintenance/compressOld.php +++ b/maintenance/compressOld.php @@ -32,7 +32,9 @@ * is a minimum number of KB, where cuts in * */ - + +die( 'compressOld is known to be broken at the moment.' ); + $optionsWithArgs = array( 't', 'c', 's', 'f', 'h' ); require_once( "commandLine.inc" ); require_once( "compressOld.inc" ); -- 2.20.1