Index: branches/REL1_17/extensions/InterwikiList/InterwikiList_body.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | |
44 | 44 | $conds = array(); |
45 | 45 | if ( !is_null( $prefix ) ) { |
46 | | - $conds[] = "iw_prefix LIKE " . $dbr->addQuotes( $dbr->escapeLike( $prefix ) . "%" ); |
| 46 | + $conds[] = "iw_prefix " . $dbr->buildLike( $prefix, $dbr->anyString() ); |
47 | 47 | } |
48 | 48 | |
49 | 49 | $results = $dbr->select( 'interwiki', array( 'iw_prefix', 'iw_url' ), $conds ); |
Index: branches/REL1_17/extensions/DeleteBatch/DeleteBatch.body.php |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | $art = new ImagePage( $page ); |
317 | 317 | /*this is absolutely required - creating a new ImagePage object does not automatically |
318 | 318 | provide it with image */ |
319 | | - $art->img = new Image( $art->mTitle ); |
| 319 | + $art->img = wfFindFile( $art->mTitle ); |
320 | 320 | } else { |
321 | 321 | $art = new Article( $page ); |
322 | 322 | } |
Index: branches/REL1_17/extensions/SmoothGallery/SmoothGalleryParser.php |
— | — | @@ -205,7 +205,8 @@ |
206 | 206 | |
207 | 207 | // Create a thumbnail the same size as our gallery so that |
208 | 208 | // full images fit correctly |
209 | | - $full_thumb_obj = $img_obj->getThumbnail( $this->argumentArray["width"], $this->argumentArray["height"] ); |
| 209 | + |
| 210 | + $full_thumb_obj = $img_obj->transform( array( 'width' => $this->argumentArray["width"], 'height' => $this->argumentArray["height"] ), 0 ); |
210 | 211 | if ( !is_null( $full_thumb_obj ) ) { |
211 | 212 | $full_thumb = $full_thumb_obj->getUrl(); |
212 | 213 | } else { |
— | — | @@ -225,7 +226,7 @@ |
226 | 227 | // We are going to show a carousel to the user; we need |
227 | 228 | // to make icon thumbnails |
228 | 229 | // $thumb_obj = $img_obj->getThumbnail( 120, 120 ); //would be nice to reuse images already loaded... |
229 | | - $thumb_obj = $img_obj->getThumbnail( $wgSmoothGalleryThumbWidth, $wgSmoothGalleryThumbHeight ); |
| 230 | + $thumb_obj = $img_obj->transform( array( 'width' => $wgSmoothGalleryThumbWidth, 'height' => $wgSmoothGalleryThumbHeight ), 0 ); |
230 | 231 | if ( $thumb_obj ) { |
231 | 232 | $icon_thumb = $thumb_obj->getUrl(); |
232 | 233 | } |
Index: branches/REL1_17/extensions/Renameuser/Renameuser_body.php |
— | — | @@ -296,8 +296,7 @@ |
297 | 297 | array( 'page_namespace', 'page_title' ), |
298 | 298 | array( |
299 | 299 | 'page_namespace IN (' . NS_USER . ',' . NS_USER_TALK . ')', |
300 | | - '(page_title LIKE ' . |
301 | | - $dbr->addQuotes( $dbr->escapeLike( $oldusername->getDBkey() ) . '/%' ) . |
| 300 | + '(page_title ' . $dbr->buildLike( $oldusername->getDBkey() . '/', $dbr->anyString() ) . |
302 | 301 | ' OR page_title = ' . $dbr->addQuotes( $oldusername->getDBkey() ) . ')' |
303 | 302 | ), |
304 | 303 | __METHOD__ |
Index: branches/REL1_17/extensions/AntiSpoof/batchAntiSpoof.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | $result = $dbw->select( 'user', 'user_name', null, 'batchAntiSpoof.php' ); |
15 | 15 | $n = 0; |
16 | | -foreach( $res as $row ) { |
| 16 | +foreach( $result as $row ) { |
17 | 17 | if ( $n++ % $batchSize == 0 ) { |
18 | 18 | echo "$wgDBname $n\n"; |
19 | 19 | } |
Index: branches/REL1_17/extensions/WebDAV/WebDavServer.php |
— | — | @@ -605,7 +605,7 @@ |
606 | 606 | $entryCondition = null; |
607 | 607 | foreach ( $entryConditions as $path => $revisionCondition ) { |
608 | 608 | if ( !empty( $path ) ) { |
609 | | - $pathCondition = '(page_title = ' . $dbr->addQuotes( $path ) . ' OR page_title LIKE \'' . $dbr->escapeLike( $path ) . '/%\')'; |
| 609 | + $pathCondition = '(page_title = ' . $dbr->addQuotes( $path ) . ' OR page_title ' . $dbr->buildLike( $path . '/', $dbr->anyString() ) . ')'; |
610 | 610 | |
611 | 611 | if ( !empty( $revisionCondition ) ) { |
612 | 612 | $revisionCondition = ' AND ' . $revisionCondition; |
Index: branches/REL1_17/extensions/ProofreadPage/proofread.js |
— | — | @@ -117,25 +117,20 @@ |
118 | 118 | pageFooter = pageFooter.substr( 0, pageFooter.length - 6 ); |
119 | 119 | } |
120 | 120 | |
121 | | - // escape & character |
122 | | - pageBody = pageBody.split( '&' ).join( '&' ); |
123 | | - pageHeader = pageHeader.split( '&' ).join( '&' ); |
124 | | - pageFooter = pageFooter.split( '&' ).join( '&' ); |
125 | | - |
126 | 121 | container.innerHTML = '' + |
127 | 122 | '<div id="prp_header" style="">' + |
128 | 123 | '<span style="color:gray;font-size:80%;line-height:100%;">' + |
129 | 124 | escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_header' ) ) + '</span>' + |
130 | | - '<textarea name="wpHeaderTextbox" rows="2" cols="80" tabindex=1>' + pageHeader + '</textarea><br />' + |
| 125 | + '<textarea name="wpHeaderTextbox" rows="2" cols="80" tabindex=1>' + escapeQuotesHTML( pageHeader ) + '</textarea><br />' + |
131 | 126 | '<span style="color:gray;font-size:80%;line-height:100%;">' + |
132 | 127 | escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_body' ) ) + '</span></div>' + |
133 | 128 | '<textarea name="wpTextbox1" id="wpTextbox1" tabindex=1 style="height:' + ( self.DisplayHeight - 6 ) + 'px;">' + |
134 | | - pageBody + '</textarea>' + |
| 129 | + escapeQuotesHTML( pageBody ) + '</textarea>' + |
135 | 130 | '<div id="prp_footer" style="">' + |
136 | 131 | '<span style="color:gray;font-size:80%;line-height:100%;">' + |
137 | 132 | escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_footer' ) ) + '</span><br />' + |
138 | 133 | '<textarea name="wpFooterTextbox" rows="2" cols="80" tabindex=1>' + |
139 | | - pageFooter + '</textarea></div>'; |
| 134 | + escapeQuotesHTML( pageFooter ) + '</textarea></div>'; |
140 | 135 | } |
141 | 136 | |
142 | 137 | function pr_reset_size() { |
— | — | @@ -951,13 +946,13 @@ |
952 | 947 | |
953 | 948 | if( !proofreadPageAddButtons ) { |
954 | 949 | f.innerHTML = |
955 | | - ' <input type="hidden" name="wpProofreader" value="' + self.proofreadpage_username + '">' + |
956 | | - '<input type="hidden" name="quality" value=' + self.proofreadpage_quality + ' >'; |
| 950 | + ' <input type="hidden" name="wpProofreader" value="' + escapeQuotesHTML( self.proofreadpage_username ) + '">' + |
| 951 | + '<input type="hidden" name="quality" value="' + escapeQuotesHTML( self.proofreadpage_quality ) + '" >'; |
957 | 952 | return; |
958 | 953 | } |
959 | 954 | |
960 | 955 | f.innerHTML = |
961 | | -' <input type="hidden" name="wpProofreader" value="' + self.proofreadpage_username + '">' |
| 956 | +' <input type="hidden" name="wpProofreader" value="' + escapeQuotesHTML( self.proofreadpage_username ) + '">' |
962 | 957 | +'<span class="quality0"> <input type="radio" name="quality" value=0 onclick="pr_add_quality(this.form,0)" tabindex=4> </span>' |
963 | 958 | +'<span class="quality2"> <input type="radio" name="quality" value=2 onclick="pr_add_quality(this.form,2)" tabindex=4> </span>' |
964 | 959 | +'<span class="quality1"> <input type="radio" name="quality" value=1 onclick="pr_add_quality(this.form,1)" tabindex=4> </span>' |
Index: branches/REL1_17/extensions/WikiTrust/sql/create_db.php |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | // Load all of the MW files. |
75 | 75 | include($mw_root."/maintenance/commandLine.inc"); |
76 | 76 | |
77 | | -global $wgDBserver, $wgDBname, $wgDBuser, $wgDBprefix, $wgCreateRevisionIndex; |
| 77 | +global $wgDBserver, $wgDBname, $wgDBtype, $wgDBuser, $wgDBprefix, $wgCreateRevisionIndex; |
78 | 78 | |
79 | 79 | // Source the update scripts |
80 | 80 | require($mw_root."/extensions/WikiTrust/includes/TrustUpdateScripts.inc"); |
— | — | @@ -103,7 +103,14 @@ |
104 | 104 | } |
105 | 105 | |
106 | 106 | // We need root priveledges to do this. |
107 | | -$db_root = Database::newFromParams($wgDBserver, $dba, $dba_pass, $wgDBname); |
| 107 | +$db_root = DatabaseBase::newFromType( $wgDBtype, |
| 108 | + array( |
| 109 | + 'host' => $wgDBserver, |
| 110 | + 'user' => $dba, |
| 111 | + 'password' => $dba_pass, |
| 112 | + 'dbname' => $wgDBname |
| 113 | + ) |
| 114 | +); |
108 | 115 | |
109 | 116 | if (!$do_remove){ |
110 | 117 | // Now do the actual creating of tables. |
Index: branches/REL1_17/extensions/MassBlank/MassBlank_body.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | foreach( $pages as $info ) { |
96 | 96 | list( $title, $edits ) = $info; |
97 | 97 | $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
98 | | - $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false; |
| 98 | + $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false; |
99 | 99 | |
100 | 100 | $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) ); |
101 | 101 | |
Index: branches/REL1_17/extensions/News/NewsRenderer.php |
— | — | @@ -640,7 +640,7 @@ |
641 | 641 | $image = false; |
642 | 642 | } |
643 | 643 | |
644 | | - $thumb = $image ? $image->getThumbnail(80, 16) : null; |
| 644 | + $thumb = $image ? $image->transform( array( 'width' => 80, 'height' => 16 ), 0 ) : null; |
645 | 645 | if ($image && !$thumb) $thumb = $image; |
646 | 646 | $iconurl = $thumb ? $thumb->getUrl() : null; |
647 | 647 | |
Index: branches/REL1_17/extensions/OpenSearchXml/ApiOpenSearchXml.php |
— | — | @@ -31,6 +31,8 @@ |
32 | 32 | */ |
33 | 33 | class ApiOpenSearchXml extends ApiOpenSearch { |
34 | 34 | |
| 35 | + private $mSeen; |
| 36 | + |
35 | 37 | public function getCustomPrinter() { |
36 | 38 | $format = $this->validateFormat(); |
37 | 39 | $printer = $this->getMain()->createPrinterByName( $format ); |
— | — | @@ -103,7 +105,7 @@ |
104 | 106 | $item['Description']['*'] = $extract; |
105 | 107 | $item['Url']['*'] = $title->getFullUrl(); |
106 | 108 | if( $image ) { |
107 | | - $thumb = $image->getThumbnail( 50, 50, false ); |
| 109 | + $thumb = $image->transform( array( 'width' => 50, 'height' => 50 ), 0 ); |
108 | 110 | $item['Image'] = array( |
109 | 111 | 'source' => wfExpandUrl( $thumb->getUrl() ), |
110 | 112 | //alt |
— | — | @@ -125,7 +127,11 @@ |
126 | 128 | return $title; |
127 | 129 | } |
128 | 130 | } |
129 | | - |
| 131 | + |
| 132 | + /** |
| 133 | + * @param $title Title |
| 134 | + * @return bool |
| 135 | + */ |
130 | 136 | protected function _seen( $title ) { |
131 | 137 | $name = $title->getPrefixedText(); |
132 | 138 | if( isset( $this->mSeen[$name] ) ) { |
— | — | @@ -317,7 +323,12 @@ |
318 | 324 | } |
319 | 325 | return ''; |
320 | 326 | } |
321 | | - |
| 327 | + |
| 328 | + /** |
| 329 | + * @param $title Title |
| 330 | + * @param $fromText |
| 331 | + * @return File |
| 332 | + */ |
322 | 333 | protected function getBadge( $title, $fromText ) { |
323 | 334 | if( $title->getNamespace() == NS_IMAGE ) { |
324 | 335 | $image = wfFindFile( $title ); |
Index: branches/REL1_17/extensions/OpenSearchXml/OpenSearchXml.php |
— | — | @@ -28,11 +28,12 @@ |
29 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:OpenSearchXml' |
30 | 30 | ); |
31 | 31 | |
32 | | -$wgExtensionMessagesFiles['OpenSearchXml'] = dirname(__FILE__) . '/OpenSearchXml.i18n.php'; |
| 32 | +$dir = dirname(__FILE__); |
33 | 33 | |
| 34 | +$wgExtensionMessagesFiles['OpenSearchXml'] = $dir . '/OpenSearchXml.i18n.php'; |
| 35 | + |
34 | 36 | $wgAPIModules['opensearch'] = 'ApiOpenSearchXml'; |
35 | | -$wgAutoloadClasses['ApiOpenSearchXml'] = |
36 | | - dirname(__FILE__) . '/ApiOpenSearchXml.php'; |
| 37 | +$wgAutoloadClasses['ApiOpenSearchXml'] = $dir . '/ApiOpenSearchXml.php'; |
37 | 38 | |
38 | 39 | $wgHooks['OpenSearchUrls'][] = 'efOpenSearchXmlUrls'; |
39 | 40 | |
Index: branches/REL1_17/extensions/DSMW/includes/IntegrationFunctions.php |
— | — | @@ -207,7 +207,6 @@ |
208 | 208 | $indexNS = 0; |
209 | 209 | wfDebugLog( 'p2p', ' - function logootIntegrate : ' . $article ); |
210 | 210 | $dbr = wfGetDB( DB_SLAVE ); |
211 | | - $dbr->immediateBegin(); |
212 | 211 | if ( is_string( $article ) ) { |
213 | 212 | // if there is a space in the title, repalce by '_' |
214 | 213 | $article = str_replace( " ", "_", $article ); |
— | — | @@ -296,7 +295,6 @@ |
297 | 296 | */ |
298 | 297 | function logootIntegrateAtt( $article, $edit ) { |
299 | 298 | $dbr = wfGetDB( DB_SLAVE ); |
300 | | - $dbr->immediateBegin(); |
301 | 299 | $title = Title::newFromText( $article ); |
302 | 300 | $lastRevision = Revision::loadFromTitle( $dbr, $title ); |
303 | 301 | |
Index: branches/REL1_17/extensions/TitleKey/TitleKey_body.php |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | array( |
210 | 210 | 'tk_page=page_id', |
211 | 211 | 'tk_namespace' => $ns, |
212 | | - 'tk_key LIKE \'' . $dbr->escapeLike( $key ) . '%\'', |
| 212 | + 'tk_key ' . $dbr->buildLike( $key, $dbr->anyString() ), |
213 | 213 | ), |
214 | 214 | __METHOD__, |
215 | 215 | array( |
Index: branches/REL1_17/extensions/RandomImage/RandomImage.class.php |
— | — | @@ -82,9 +82,7 @@ |
83 | 83 | * @return bool |
84 | 84 | */ |
85 | 85 | protected function imageExists( $title ) { |
86 | | - $file = function_exists( 'wfFindFile' ) |
87 | | - ? wfFindFile( $title ) |
88 | | - : new Image( $title ); |
| 86 | + $file = wfFindFile( $title ); |
89 | 87 | return is_object( $file ) && $file->exists(); |
90 | 88 | } |
91 | 89 | |
Index: branches/REL1_17/extensions/Nuke/Nuke_body.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | foreach( $pages as $info ) { |
136 | 136 | list( $title, $edits ) = $info; |
137 | 137 | $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
138 | | - $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false; |
| 138 | + $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false; |
139 | 139 | |
140 | 140 | $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) ); |
141 | 141 | |
Index: branches/REL1_17/extensions/Wikilog/WikilogQuery.php |
— | — | @@ -674,8 +674,7 @@ |
675 | 675 | if ( $this->mItem !== null ) { |
676 | 676 | $q_conds['wlc_post'] = $this->mItem->getID(); |
677 | 677 | if ( $this->mThread ) { |
678 | | - $thread = $db->escapeLike( $this->mThread ); |
679 | | - $q_conds[] = "wlc_thread LIKE '{$thread}/%'"; |
| 678 | + $q_conds[] = "wlc_thread " . $db->buildLike( $this->mThread . '/', $db->anyString() ); |
680 | 679 | } |
681 | 680 | } elseif ( $this->mWikilog !== null ) { |
682 | 681 | $join_wlp = true; |
Index: branches/REL1_17/extensions/Wikilog/WikilogComment.php |
— | — | @@ -478,9 +478,8 @@ |
479 | 479 | if ( is_array( $thread ) ) { |
480 | 480 | $thread = implode( '/', $thread ); |
481 | 481 | } |
482 | | - $thread = $dbr->escapeLike( $thread ); |
483 | 482 | return self::fetchFromConds( $dbr, |
484 | | - array( 'wlc_post' => $itemid, "wlc_thread LIKE '{$thread}/%'" ), |
| 483 | + array( 'wlc_post' => $itemid, "wlc_thread " . $dbr->buildLike( $thread . '/', $dbr->anyString() ) ), |
485 | 484 | array( 'ORDER BY' => 'wlc_thread, wlc_id' ) |
486 | 485 | ); |
487 | 486 | } |
Index: branches/REL1_17/extensions/MetavidWiki/includes/articlepages/MV_CategoryPage.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | } |
98 | 98 | function addMVThumb( Title $title, $sortkey, $pageLength, $isRedirect = false ) { |
99 | 99 | if ( $this->showGallery ) { |
100 | | - $image = new MV_Image( $title ); |
| 100 | + $image = wfFindFile( $title ); |
101 | 101 | if ( $this->flip ) { |
102 | 102 | $this->gallery->insert( $image ); |
103 | 103 | } else { |
Index: branches/REL1_17/extensions/IndexFunction/SpecialIndex.php |
— | — | @@ -112,12 +112,13 @@ |
113 | 113 | $indexconds[] = 'in_title' . $operator . $this->mDb->addQuotes( $offset ); |
114 | 114 | } |
115 | 115 | $ns = $this->mSearchTitle->getNamespace(); |
116 | | - $like = $this->mDb->escapeLike( $this->mSearchTitle->getDBkey() ) . '%'; |
| 116 | + |
| 117 | + $like = $this->mDb->buildLike( $this->mSearchTitle->getDBkey(), $this->mDb->anyString() ); |
117 | 118 | |
118 | 119 | $pageconds[] = "page_namespace = $ns"; |
119 | | - $pageconds[] = "page_title LIKE '$like'"; |
| 120 | + $pageconds[] = "page_title " . $like; |
120 | 121 | $indexconds[] = "in_namespace = $ns"; |
121 | | - $indexconds[] = "in_title LIKE '$like'"; |
| 122 | + $indexconds[] = "in_title " . $like; |
122 | 123 | |
123 | 124 | |
124 | 125 | $pagequery = $this->mDb->selectSQLText( 'page', |
Index: branches/REL1_17/extensions/NewUserNotif/NewUserNotif.class.php |
— | — | @@ -37,13 +37,13 @@ |
38 | 38 | * Send email to external addresses |
39 | 39 | */ |
40 | 40 | private function sendExternalMails() { |
41 | | - global $wgNewUserNotifEmailTargets, $wgNewUserNotifSenderParam, $wgNewUserNotifSenderSubjParam; |
| 41 | + global $wgNewUserNotifEmailTargets, $wgSitename; |
42 | 42 | foreach( $wgNewUserNotifEmailTargets as $target ) { |
43 | 43 | UserMailer::send( |
44 | 44 | new MailAddress( $target ), |
45 | 45 | new MailAddress( $this->sender ), |
46 | | - $this->makeMessage( $target, $this->user, 'newusernotifsubj', $wgNewUserNotifSenderSubjParam), |
47 | | - $this->makeMessage( $target, $this->user, 'newusernotifbody', $wgNewUserNotifSenderParam) |
| 46 | + wfMsgForContent( 'newusernotifsubj', $wgSitename ), |
| 47 | + $this->makeMessage( $target, $this->user ) |
48 | 48 | ); |
49 | 49 | } |
50 | 50 | } |
— | — | @@ -52,13 +52,13 @@ |
53 | 53 | * Send email to users |
54 | 54 | */ |
55 | 55 | private function sendInternalMails() { |
56 | | - global $wgNewUserNotifTargets, $wgNewUserNotifSenderParam, $wgNewUserNotifSenderSubjParam; |
| 56 | + global $wgNewUserNotifTargets, $wgSitename; |
57 | 57 | foreach( $wgNewUserNotifTargets as $userSpec ) { |
58 | 58 | $user = $this->makeUser( $userSpec ); |
59 | 59 | if( $user instanceof User && $user->isEmailConfirmed() ) { |
60 | 60 | $user->sendMail( |
61 | | - $this->makeMessage( $user->getName(), $this->user, 'newusernotifsubj', $wgNewUserNotifSenderSubjParam ), |
62 | | - $this->makeMessage( $user->getName(), $this->user, 'newusernotifbody', $wgNewUserNotifSenderParam ), |
| 61 | + wfMsgForContent( 'newusernotifsubj', $wgSitename ), |
| 62 | + $this->makeMessage( $user->getName(), $this->user ), |
63 | 63 | $this->sender |
64 | 64 | ); |
65 | 65 | } |
— | — | @@ -80,18 +80,22 @@ |
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | | - * Build a notification email message (body and subject) |
| 84 | + * Build a notification email |
85 | 85 | * |
86 | | - * @param string $recipient Name of the new user notification email recipient |
87 | | - * @param User $user User (object) created for new user |
88 | | - * @param string $msgId Localised Message Identifier |
89 | | - * @param string $parmArr Array of Strings eval'd to pass parameters to message |
90 | | - * @return string |
| 86 | + * @param string $recipient Name of the recipient |
| 87 | + * @param User $user User that was created |
91 | 88 | */ |
92 | | - private function makeMessage( $recipient, $user, $msgId, $parmArr) { |
93 | | - global $wgSitename,$wgContLang; |
94 | | - eval( "\$retval = wfMsgForContent('".$msgId."',".implode(",",$parmArr).");" ); |
95 | | - return ($retval); |
| 89 | + private function makeMessage( $recipient, $user ) { |
| 90 | + global $wgSitename, $wgContLang; |
| 91 | + return wfMsgForContent( |
| 92 | + 'newusernotifbody', |
| 93 | + $recipient, |
| 94 | + $user->getName(), |
| 95 | + $wgSitename, |
| 96 | + $wgContLang->timeAndDate( wfTimestampNow() ), |
| 97 | + $wgContLang->date( wfTimestampNow() ), |
| 98 | + $wgContLang->time( wfTimestampNow() ) |
| 99 | + ); |
96 | 100 | } |
97 | 101 | |
98 | 102 | /** |
Index: branches/REL1_17/extensions/NewUserNotif/README |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | NEW USER EMAIL NOTIFICATION EXTENSION |
3 | | -(http://www.mediawiki.org/wiki/Extension:New_User_Email_Notification) |
4 | 3 | |
5 | 4 | Version 1.5 |
6 | 5 | © 2006-2007 Rob Church |
— | — | @@ -14,9 +13,8 @@ |
15 | 14 | 2. Installation requirements |
16 | 15 | 3. Installing the extension |
17 | 16 | 4. Editing the notification email |
18 | | - 5. Configuration |
19 | | - 6. Advanced Configuration |
20 | | - 7. Feedback |
| 17 | + 5. Further configuration |
| 18 | + 6. Feedback |
21 | 19 | |
22 | 20 | == 1. Introduction == |
23 | 21 | |
— | — | @@ -53,12 +51,9 @@ |
54 | 52 | $2 is replaced with the username of the new user account; |
55 | 53 | $3 is replaced with the wiki site name from $wgSitename; |
56 | 54 | $4 is replaced with the time and date of the account's creation. |
57 | | - $5 is replaced with the date of the account's creation. |
58 | | - $6 is replaced with the time of the account's creation. |
59 | 55 | |
| 56 | +== 5. Further configuration == |
60 | 57 | |
61 | | -== 5. Configuration == |
62 | | - |
63 | 58 | The behaviour of the extension can be tweaked using three configuration |
64 | 59 | variables. To override the defaults for these, set them in LocalSettings.php |
65 | 60 | underneath the call to the extension file. |
— | — | @@ -78,76 +73,7 @@ |
79 | 74 | $wgNewUserNotifEmailTargets |
80 | 75 | Array containing email addresses to which a notification should also be sent |
81 | 76 | Defaults to no additional addresses |
82 | | - |
83 | | -== 6. Advanced Configuration == |
84 | 77 | |
85 | | -As of version 1.5.2 of this extension, you can customize and add parameters passed to both the subject and body messages in your localsettings.php without modifying the extension code. |
| 78 | +== 6. Feedback == |
86 | 79 | |
87 | | -You can do this by adding (or changing) parameter values and/or functions that return the desired parameter values to the parameter definition arrays underneath the call to the extension file. In both cases you can use references to $this, $user (created user object), $recipient (target), or from globals $wfContLang, $wgSitename. (For advanced techniques and using other globals, see below). |
88 | | - |
89 | | -$wgNewUserNotifSenderSubjParam |
90 | | - The list of evaluated parameters passed to the message subject(MediaWiki:Newusernotifsubj). Default is: |
91 | | - '$wgSitename', // $1 Site Name |
92 | | - |
93 | | -$wgNewUserNotifSenderParam |
94 | | - The list of evaluated parameters passed to the message body(MediaWiki:Newusernotifbody). Defaults are: |
95 | | - '$recipient', // $1 Recipient (of notification message) |
96 | | - '$user->getname()', // $2 User Name |
97 | | - '$wgSitename', // $3 Site Name |
98 | | - '$wgContLang->timeAndDate( wfTimestampNow() )', // $4 Time and date stamp |
99 | | - '$wgContLang->date( wfTimestampNow() )', // $5 Date Stamp |
100 | | - '$wgContLang->time( wfTimestampNow() )', // $6 Time Stamp |
101 | | - |
102 | | -You can then either edit MediaWiki:Newusernotifbody to make use of the new parameters (e.g. add "\n\nThe request came from $7."). |
103 | | - |
104 | | -=== 6.1 Upgrading from 1.5.1 === |
105 | | - |
106 | | -If you did not customize the passed parameters, this extension works exactly as before and no action need to be taken. |
107 | | - |
108 | | -If you added to or changed the default passed parameters, you will need to correspondingly add to or change the corresponding arrays. You should be able to take the exact same code and add to or replace it in the arrays. |
109 | | - |
110 | | -For example, if you added a 7th parameter (in his case, the email address of the new user), you would just add it (in localsettings.php, below the extension reference) like this: |
111 | | - |
112 | | -<source lang="php"> |
113 | | -$wgNewUserNotifSenderParam[] = '$user->getEmail()'; // $7 new user email address |
114 | | -</source> |
115 | | - |
116 | | -The code for the parameter to be passed should be exactly the same (except enclosed in quotes) as it is in your modified wfMsgForContent function call found in private function makeMessage. |
117 | | - |
118 | | -=== 6.2 Examples For Adding Additional Parameters === |
119 | | - |
120 | | -Here are some commonly used additional parameter you could add to further customize your notification message subject and body: |
121 | | -<source lang="php"> |
122 | | -$wgNewUserNotifSenderParam[] = '$user->getEmail()'; // $7 email |
123 | | -$wgNewUserNotifSenderParam[] = 'rawurlencode($wgSitename)'; // $8 Escaped for email message |
124 | | -$wgNewUserNotifSenderParam[] = 'wfGetIP()'; // $9 Submitter's IP Address |
125 | | -</source> |
126 | | - |
127 | | -Of course if you wanted to pass these parameter(s) to the subject message, you would add them to the $wgNewUserNotifSenderSubjParam array instead of the $wgNewUserNotifSenderParam array. |
128 | | - |
129 | | -=== 6.4 Some Technique/Tricks for Adding Additional Parameters === |
130 | | - |
131 | | -Let's say you wanted to use a global variable or reference other than $this, $user (created user object), $recipient (target), $wfContLang, or $wgSitename. |
132 | | - |
133 | | -You could do so by directly referencing a previously assigned global. Example: |
134 | | - |
135 | | -<source lang="php"> |
136 | | -$wgNewUserNotifSenderParam[] = '$GLOBALS["wgUser"]->getEmail()'; // $10 email |
137 | | -</source> |
138 | | - |
139 | | -Note: This isn't the best example, because it would be easier to use the $user object ('$user->getEmail()'), but it gives you an idea how you could reference the global variable (in this case objec) $wgUser directly. |
140 | | - |
141 | | -=== 6.5 Advanced Customization Prior to 1.5.2 === |
142 | | - |
143 | | -If you want to change the parameters passed in a version prior to 1.5.2, you would need to modify the extension code directly in wfMsgForContent function call found in private function makeMessage of NewUserNotif.class.php. |
144 | | - |
145 | | -== 7. Feedback == |
146 | | - |
147 | | -Bugs and enhancement requests should be submitted through bugzilla for the MediaWiki Extensions at: |
148 | | - |
149 | | -https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions |
150 | | - |
151 | | -For comments and discussion, see: |
152 | | - |
153 | | -http://www.mediawiki.org/wiki/Extension_talk:New_User_Email_Notification |
154 | | - |
| 80 | +All feedback, bug reports, etc. welcome via <robchur@gmail.com>. |
\ No newline at end of file |
Index: branches/REL1_17/extensions/NewUserNotif/NewUserNotif.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | if ( ! defined( 'MEDIAWIKI' ) ) |
4 | | - die(); |
| 4 | + die(); |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Extension to provide customisable email notification of new user creation |
— | — | @@ -13,9 +13,9 @@ |
14 | 14 | */ |
15 | 15 | |
16 | 16 | $wgExtensionCredits['other'][] = array( |
17 | | - 'path' => __FILE__, |
| 17 | + 'path' => __FILE__, |
18 | 18 | 'name' => 'New User Email Notification', |
19 | | - 'version' => '1.5.2', |
| 19 | + 'version' => '1.5.1', |
20 | 20 | 'author' => 'Rob Church', |
21 | 21 | 'url' => 'http://www.mediawiki.org/wiki/Extension:New_User_Email_Notification', |
22 | 22 | 'descriptionmsg' => 'newusernotif-desc', |
— | — | @@ -40,26 +40,6 @@ |
41 | 41 | * Additional email addresses to send mails to |
42 | 42 | */ |
43 | 43 | $wgNewUserNotifEmailTargets = array(); |
44 | | -/** |
45 | | - * These are the parameters that will be passed into MediaWiki:newusernotifbody |
46 | | - * Can use anthing available as part of $this, $user (created user object), $recipient (target), |
47 | | - * or from globals $wgContLang, $wgSitename |
48 | | - */ |
49 | | -$wgNewUserNotifSenderParam = array( |
50 | | - '$recipient', // $1 Recipient (of notification message) |
51 | | - '$user->getname()', // $2 User Name |
52 | | - '$wgSitename', // $3 Site Name |
53 | | - '$wgContLang->timeAndDate( wfTimestampNow() )', // $4 Time and date stamp |
54 | | - '$wgContLang->date( wfTimestampNow() )', // $5 Date Stamp |
55 | | - '$wgContLang->time( wfTimestampNow() )', // $6 Time Stamp |
56 | | -); |
57 | | -/** |
58 | | - * These are the parameters that will be passed into MediaWiki:Newusernotifsubj (for use in the "subject:" line) |
59 | | - * parameters defs have same options as $wgNewUserNotifSenderParam |
60 | | - */ |
61 | | -$wgNewUserNotifSenderSubjParam = array( |
62 | | - '$wgSitename', // $1 Site Name |
63 | | -); |
64 | 44 | |
65 | 45 | /** |
66 | 46 | * Extension setup |
Index: branches/REL1_17/extensions/Asksql/Asksql_body.php |
— | — | @@ -85,15 +85,24 @@ |
86 | 86 | function doSubmit() { |
87 | 87 | global $wgOut, $wgUser, $wgServer, $wgScript, $wgLang, $wgContLang; |
88 | 88 | global $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname, $wgSqlTimeout; |
| 89 | + global $wgDBtype; |
89 | 90 | |
90 | 91 | # Use a limit, folks! |
91 | 92 | $this->query = trim( $this->query ); |
92 | 93 | if ( preg_match( '/^SELECT/i', $this->query ) |
93 | | - and !preg_match( '/LIMIT/i', $this->query ) ) { |
| 94 | + && !preg_match( '/LIMIT/i', $this->query ) ) { |
94 | 95 | $this->query .= ' LIMIT 100'; |
95 | 96 | } |
96 | | - $conn = Database::newFromParams( $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname ); |
97 | 97 | |
| 98 | + $conn = DatabaseBase::newFromType( $wgDBtype, |
| 99 | + array( |
| 100 | + 'host' => $wgDBserver, |
| 101 | + 'user' => $wgDBsqluser, |
| 102 | + 'password' => $wgDBsqlpassword, |
| 103 | + 'dbname' => $wgDBname |
| 104 | + ) |
| 105 | + ); |
| 106 | + |
98 | 107 | $this->logQuery( $this->query ); |
99 | 108 | |
100 | 109 | # Start timer, will kill the DB thread in $wgSqlTimeout seconds |
— | — | @@ -118,7 +127,7 @@ |
119 | 128 | } |
120 | 129 | |
121 | 130 | $a = array(); |
122 | | - while ( $s = $conn->fetchObject( $res ) ) { |
| 131 | + foreach ( $res as $s ) { |
123 | 132 | array_push( $a, $s ); |
124 | 133 | } |
125 | 134 | $conn->freeResult( $res ); |
Index: branches/REL1_17/extensions/FCKeditor/FCKeditorSkin.body.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | function makeImageLinkObj( $nt, $label, $alt, $align = '', $params = array(), $framed = false, |
22 | 22 | $thumb = false, $manual_thumb = '', $valign = '' ) { |
23 | 23 | $orginal = $nt->getText(); |
24 | | - $img = new Image( $nt ); |
| 24 | + $img = wfFindFile( $nt ); |
25 | 25 | $imgName = $img->getName(); |
26 | 26 | $found = $img->getURL(); |
27 | 27 | |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | */ |
121 | 121 | function makeImageLink2( Title $nt, $file, $frameParams = array(), $handlerParams = array() ) { |
122 | 122 | $orginal = $nt->getText(); |
123 | | - $img = new Image( $nt ); |
| 123 | + $img = wfFindFile( $nt ); |
124 | 124 | $imgName = $img->getName(); |
125 | 125 | $found = $img->getURL(); |
126 | 126 | |
Index: branches/REL1_17/extensions/Player/PlayerClass.php |
— | — | @@ -383,7 +383,8 @@ |
384 | 384 | if ($thumbname) $thumbimg = wfFindFile( $thumbname ); |
385 | 385 | |
386 | 386 | if ($thumbimg && $thumbimg->exists()) { |
387 | | - $tni = $thumbimg->getThumbnail( $this->width, $this->height ); |
| 387 | + |
| 388 | + $tni = $thumbimg->transform( array( 'width' => $this->width, 'height' => $this->height ), 0 ); |
388 | 389 | if ($tni) $thumbstyle = 'background-image:url('.$tni->getUrl().'); background-position:center; background-repeat:no-repeat; text-decoration:none;'; |
389 | 390 | } |
390 | 391 | |
Index: branches/REL1_17/extensions/SecurePoll/includes/entities/Entity.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Get the parent election |
66 | | - * @return Int |
| 66 | + * @return SecurePoll_Election |
67 | 67 | */ |
68 | 68 | public function getElection() { |
69 | 69 | return $this->electionId !== null |
Index: branches/REL1_17/extensions/SecurePoll/includes/entities/Election.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | * Get the election's parent election... hmm... |
95 | 95 | */ |
96 | 96 | function getElection() { |
97 | | - return $this->id; |
| 97 | + return $this; |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
Index: branches/REL1_17/extensions/SecurePoll/includes/main/Store.php |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | return $questions; |
231 | 231 | } |
232 | 232 | |
233 | | - function callbackValidVotes( $electionId, $callback, $voterId=null ) { |
| 233 | + function callbackValidVotes( $electionId, $callback, $voterId = null ) { |
234 | 234 | $dbr = $this->getDB(); |
235 | 235 | $where = array( |
236 | 236 | 'vote_election' => $electionId, |
— | — | @@ -356,7 +356,7 @@ |
357 | 357 | } |
358 | 358 | |
359 | 359 | function getEntityType( $id ){ |
360 | | - return array_key_exists( $this->entityInfo[$id] ) |
| 360 | + return isset( $this->entityInfo[$id] ) |
361 | 361 | ? $this->entityInfo[$id]['type'] |
362 | 362 | : false; |
363 | 363 | } |
Index: branches/REL1_17/extensions/SecurePoll/includes/main/Context.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | /** Get the type of a particular entity **/ |
100 | | - function getEntityType( $id ){ |
| 100 | + function getEntityType( $id ) { |
101 | 101 | return $this->getStore()->getEntityType( $id ); |
102 | 102 | } |
103 | 103 | |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | * false if it does not exist. |
107 | 107 | */ |
108 | 108 | function getElection( $id ) { |
109 | | - if( !isset( $this->electionCache[$id] ) ){ |
| 109 | + if( !isset( $this->electionCache[$id] ) ) { |
110 | 110 | $info = $this->getStore()->getElectionInfo( array( $id ) ); |
111 | 111 | if ( $info ) { |
112 | 112 | $this->electionCache[$id] = $this->newElection( reset( $info ) ); |
Index: branches/REL1_17/extensions/WatchSubpages/WatchSubpages_body.php |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | array( 'page_namespace', 'page_title', 'page_id', 'page_is_redirect' ), |
256 | 256 | array( |
257 | 257 | 'page_namespace' => $prefixNS, |
258 | | - 'page_title LIKE \'' . $dbr->escapeLike( $prefixKey ) .'%\'', |
| 258 | + 'page_title ' . $dbr->buildLike( $prefixKey, $dbr->anyString() ), |
259 | 259 | ), |
260 | 260 | __METHOD__, |
261 | 261 | array( |
Index: branches/REL1_17/extensions/auth/GlobalAuth.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | $fname ); |
95 | 95 | while ( $row = $dbr->fetchObject( $res ) ) { |
96 | 96 | if ( $row->user_wiki == $this->thiswiki || $row->user_wiki == '*' ) { |
97 | | - if ( $row->user_password == wfEncryptPassword( $row->user_id, $password ) ) { |
| 97 | + if ( $row->user_password == User::oldCrypt( $password, $row->user_id ) ) { |
98 | 98 | $this->data =& $row; |
99 | 99 | return true; |
100 | 100 | } |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | function setPassword( $password ) { |
155 | 155 | $dbw = wfGetDB( DB_MASTER ); |
156 | 156 | $success = $dbw->update( $this->tablename, |
157 | | - array( 'user_password' => wfEncryptPassword( $this->data->user_id, $password ) ), |
| 157 | + array( 'user_password' => User::oldCrypt( $password, $this->data->user_id ) ), |
158 | 158 | array( 'user_id' => $this->data->user_id, |
159 | 159 | 'user_wiki' => $this->data->user_wiki ), |
160 | 160 | 'GlobalAuth::setPassword' ); |
— | — | @@ -226,7 +226,7 @@ |
227 | 227 | return false; |
228 | 228 | # The password matches one of the already existing accounts. |
229 | 229 | # Allow creation of an account. |
230 | | - if ( $row->user_password == wfEncryptPassword( $row->user_id, $password ) ) { |
| 230 | + if ( $row->user_password == User::oldCrypt( $password, $row->user_id ) ) { |
231 | 231 | $create = true; |
232 | 232 | } |
233 | 233 | } |
Index: branches/REL1_17/extensions/WikimediaIncubator/TestWikiRC.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | $dbr = wfGetDB( DB_SLAVE ); |
27 | 27 | $namespaces = array( NS_MAIN, NS_TALK, NS_TEMPLATE, NS_TEMPLATE_TALK, NS_CATEGORY, NS_CATEGORY_TALK ); |
28 | 28 | $conds[] = 'rc_namespace IN (' . $dbr->makeList( $namespaces ) . ')'; |
29 | | - $conds[] = 'rc_title like ' . $dbr->addQuotes( $dbr->escapeLike( $fullprefix ) . '/%' ) . |
| 29 | + $conds[] = 'rc_title ' . $dbr->buildLike( $fullprefix . '/', $dbr->anyString() ) . |
30 | 30 | ' OR rc_title = ' . $dbr->addQuotes( $fullprefix ); |
31 | 31 | return true; |
32 | 32 | } |
Index: branches/REL1_17/extensions/Transliterator/Transliterator_body.php |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | array( 'page_title', 'page_id' ), |
143 | 143 | array( |
144 | 144 | 'page_namespace' => NS_MEDIAWIKI, |
145 | | - 'page_title LIKE \'' . $dbr->escapeLike( self::getMapPagePrefix() ) . '%\'' |
| 145 | + 'page_title ' . $dbr->buildLike( self::getMapPagePrefix(), $dbr->anyString() ) |
146 | 146 | ), |
147 | 147 | __METHOD__ |
148 | 148 | ); |
Index: branches/REL1_17/extensions/ReplaceText/SpecialReplaceText.php |
— | — | @@ -515,10 +515,10 @@ |
516 | 516 | 'rev_text_id = old_id' |
517 | 517 | ); |
518 | 518 | } else { |
519 | | - $search = $dbr->escapeLike( $search ); |
| 519 | + $any = $dbr->anyString(); |
520 | 520 | $include_ns = $dbr->makeList( $namespaces ); |
521 | 521 | $conds = array( |
522 | | - "old_text LIKE '%$search%'", |
| 522 | + "old_text " . $dbr->buildLike( $any, $search, $any ), |
523 | 523 | "page_namespace IN ($include_ns)", |
524 | 524 | 'rev_id = page_latest', |
525 | 525 | 'rev_text_id = old_id' |
Index: branches/REL1_17/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -295,7 +295,9 @@ |
296 | 296 | $dbPatch = "$base/" . ( $updater->getDB()->getType() == 'postgres' ? |
297 | 297 | 'openid_table.pg.sql' : 'openid_table.sql' ); |
298 | 298 | $updater->addExtensionUpdate( array( 'addTable', 'user_openid', $dbPatch, true ) ); |
299 | | - $updater->addExtensionUpdate( array( array( __CLASS__, 'makeUoiUserNotUnique' ) ) ); |
| 299 | + if ( $updater->getDB()->getType() == 'mysql' ) { |
| 300 | + $updater->addExtensionUpdate( array( array( __CLASS__, 'makeUoiUserNotUnique' ) ) ); |
| 301 | + } |
300 | 302 | } |
301 | 303 | |
302 | 304 | return true; |