Changeset 1881


Ignore:
Timestamp:
02/22/2011 12:19:11 PM (15 months ago)
Author:
Xiping.Wang
Message:

[trunk]upgrade Mediawiki 1.16.2

Location:
trunk
Files:
96 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:externals
      •  

        old new  
        1 w/bin http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/bin 
        2 w/cache http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/cache 
        3 w/config http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/config 
        4 w/docs http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/docs 
        5 w/languages http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/languages 
        6 w/maintenance http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/maintenance 
        7 w/math http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/math 
        8 w/serialized http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/phase3/serialized 
        9 w/extensions/Interwiki http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_0beta3/extensions/Interwiki 
         1w/bin http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/bin 
         2w/cache http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/cache 
         3w/config http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/config 
         4w/docs http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/docs 
         5w/languages http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/languages 
         6w/maintenance http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/maintenance 
         7w/math http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/math 
         8w/serialized http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/phase3/serialized 
         9w/extensions/Interwiki http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_2/extensions/Interwiki 
  • trunk/Readme.txt

    r1496 r1881  
    133133* You may need to go into Forums Administration Control Panel as Admin/password to purge the cache. 
    134134 
    135 * 
  • trunk/w/CREDITS

    r1484 r1881  
    6363* Tom Gries 
    6464* Victor Vasiliev 
     65* Yuri Astrakhan 
    6566 
    6667== Patch Contributors == 
     
    126127* Rotem Liss 
    127128* Shinjiman 
     129* Translatewiki.net Translators http://translatewiki.net/wiki/Special:ListUsers/translator 
  • trunk/w/RELEASE-NOTES

    r1570 r1881  
    11= MediaWiki release notes = 
    22 
    3 == MediaWiki 1.16 beta 3 == 
    4  
    5 2010-05-28 
    6  
    7 This is a pre-release beta of the MediaWiki 1.16 branch. 
     3== MediaWiki 1.16.2 == 
     4 
     52011-02-01 
     6 
     7This is a security and maintenance release of the MediaWiki 1.16 branch. 
    88 
    99=== Summary of selected changes in 1.16 === 
    1010 
    1111Selected changes since MediaWiki 1.15 that may be of interest: 
     12 
     13* A new skin called Vector was added 
    1214 
    1315* Watchlists now have RSS/Atom feeds. RSS feeds generally are now hidden,  
     
    4244you have the DBA extension for PHP installed, this will improve performance  
    4345further. 
     46 
     47== Changes since 1.16.1 == 
     48 
     49* (bug 26642) Fixed incorrect translated namespace due to a regression in the 
     50  language converter. 
     51* The interface translations were updated. 
     52* (bug 27093, CVE-2011-0047): Fixed CSS injection vulnerability. 
     53* (bug 27094) Fixed server-side arbitrary script inclusion vulnerability.  
     54  Affects Windows servers only. A malicious file with extension ".php" must  
     55  exist on the server for the exploit to be effective. 
     56 
     57== Changes since 1.16.0 == 
     58 
     59* (bug 24981) Allow extensions to access SpecialUpload variables again 
     60* (bug 24724) list=allusers was out by 1 (shows total users - 1) 
     61* (bug 24166) Fixed API error when using rvprop=tags 
     62* For wikis using French as a content language, Special:Téléchargement works  
     63  again as an alias for Special:Upload. 
     64* (bug 25167) Correctly load JS fixes for IE6 (fixing a regression in 1.16.0) 
     65* (bug 25248) Fixed paraminfo errors in certain API modules. 
     66* The installer now has improved handling for situations where safe_mode is  
     67  active or exec() and similar functions are disabled. 
     68* (bug 19593) Specifying --server in now works for all maintenance scripts. 
     69* Fixed $wgLicenseTerms register globals. 
     70* (bug 26561) Fixed clickjacking vulnerabilities by introducing support for  
     71  X-Frame-Options. The header value can be configured using $wgBreakFrames and 
     72  $wgEditPageFrameOptions. 
     73 
     74== Changes since 1.16 beta 3 == 
     75 
     76* (bug 23769) Disabled HTML 5 client-side form validation. Was introduced in  
     77  1.16 beta 1, but is currently poorly supported by browsers. 
     78* (bug 23175) Re-added window.ta variable for backwards compatibility. 
     79* (bug 23264) Fixed breakage of various command line scripts due to extra line 
     80  endings being inserted by Maintenance::output(). 
     81* Fixed HTTP client functionality with safe_mode=On. 
     82* Fixed parser tests broken in 1.16 beta 3. 
     83* For Oracle DB backend: fixed parser tests and table prefix feature. 
     84* (bug 23767) Fixed PHP warning when REQUEST_URI is blank (IIS issue). 
     85* Fixed plural function for Northern Sami (se) 
     86* (bug 23597) Fixed conflicts between ID attributes in the Vector skin and  
     87  parser-generated heading IDs. Renamed head, panel, head-base and page-base. 
     88* Disabled $wgHitcounterUpdateFreq>1 feature on SQLite, does not work yet. 
     89* (bug 23465) Don't ignore the predefined destination filename on  
     90  Special:Upload after following a red link to a file. 
     91* In SQLite full-text search feature: fixed "move page" feature, was non- 
     92  functional. 
     93* (bug 24565) Fixed Cache-Control headers sent from API modules, to protect 
     94  user privacy in the case where an attacker can access the wiki through the 
     95  same HTTP proxy as a logged-in user. 
     96* Fixed an XSS vulnerability in profileinfo.php for installations with  
     97  $wgEnableProfileInfo = true (false by default) 
     98* Fixed a case where an X-Vary-Options header was sent despite $wgUseXVO being 
     99  false. Fixed a minor header parsing issue when $wgUseXVO = true. 
     100* Fixed a register_globals arbitrary inclusion vulnerability in  
     101  MediaWikiParserTest.php, introduced in 1.16 beta 1. 
    44102 
    45103== Changes since 1.16 beta 2 == 
     
    76134* (bug 23687) Fixed XSS vulnerability affecting IE clients only, due to a CSS  
    77135  validation issue. 
     136* Fixed a DoS vulnerability in ImageMagick image scaling. ImageMagick  
     137  expanded wildcard characters "?" and "*" in image filenames, potentially  
     138  causing large numbers of images to be scaled in response to a single request. 
     139  The fix for this involves breaking the scaling of such image filenames until 
     140  ImageMagick 6.6.1-5 or later is deployed, see bug 23361 for more details. 
     141* (bug 23608) Fixed invalid HTML in diff pages. 
    78142 
    79143=== Changes since 1.16 beta 1 === 
     
    172236=== New features in 1.16 === 
    173237 
     238* A new skin called Vector was added 
    174239* Add CSS defintion of the 'wikitable' class to shared.css 
    175240* (bug 17163) Added MediaWiki:Talkpageheader which will be displayed when 
     
    276341  This can be disabled by setting $wgHtml5 = false;.  Specific features enabled 
    277342  if HTML 5 is used: 
    278 ** New HTML 5 input attributes allow JavaScript-free input validation in some 
    279    cutting-edge browsers.  E.g., some inputs will be autofocused, users will 
    280    not be allowed to submit forms with certain types of invalid values (like 
    281    numbers outside the permitted ranges), etc. 
     343** Some extra inputs will be autofocused, in supporting browsers. 
    282344** The summary attribute has been removed from tables of contents.  summary is 
    283345   obsolete in HTML 5 and wasn't useful here anyway. 
     
    308370* New hook ShowMissingArticle so extensions can modify the output for 
    309371  non-existent pages. 
    310 * Added $wgUseAJAXCategories allow enabling AJAX based categories system. 
    311   This works on all namespaces. Enabled namespaces can be reduces using 
    312   $wgAJAXCategoriesNamespaces. 
    313372* Admins could disable some variants using $wgDisabledVariants now. ONLY apply 
    314373  on wikis enabled LanguageConverter. 
     
    828887 
    829888== API changes in 1.16 == 
    830  
    831889* Added uiprop=changeablegroups to meta=userinfo 
    832890* Added usprop=gender to list=users 
  • trunk/w/includes/Article.php

    r1570 r1881  
    793793                } 
    794794 
     795                # Allow frames by default 
     796                $wgOut->allowClickjacking(); 
     797 
    795798                # Should the parser cache be used? 
    796799                $useParserCache = $this->useParserCache( $oldid ); 
     
    14521455                ); 
    14531456                if ( !$dbr->numRows( $tbs ) ) return; 
     1457 
     1458                $wgOut->preventClickjacking(); 
    14541459 
    14551460                $tbtext = ""; 
     
    36623667                $hitcounterTable = $dbw->tableName( 'hitcounter' ); 
    36633668                $acchitsTable = $dbw->tableName( 'acchits' ); 
    3664  
    3665                 if ( $wgHitcounterUpdateFreq <= 1 ) { 
     3669                $dbType = $dbw->getType(); 
     3670 
     3671                if ( $wgHitcounterUpdateFreq <= 1 || $dbType == 'sqlite' ) { 
    36663672                        $dbw->query( "UPDATE $pageTable SET page_counter = page_counter + 1 WHERE page_id = $id" ); 
    36673673                        return; 
     
    36873693                        $old_user_abort = ignore_user_abort( true ); 
    36883694 
    3689                         $dbType = $dbw->getType(); 
    36903695                        $dbw->lockTables( array(), array( 'hitcounter' ), __METHOD__, false ); 
    36913696                        $tabletype = $dbType == 'mysql' ? "ENGINE=HEAP " : ''; 
  • trunk/w/includes/DefaultSettings.php

    r1570 r1881  
    3434 
    3535/** MediaWiki version number */ 
    36 $wgVersion = '1.16.0beta3'; 
     36$wgVersion = '1.16.2'; 
    3737 
    3838/** Name of the site. It must be changed in LocalSettings.php */ 
     
    16871687 * styles. 
    16881688 */ 
    1689 $wgStyleVersion = '269'; 
     1689$wgStyleVersion = '270'; 
    16901690 
    16911691 
     
    25022502$wgRightsText = null; 
    25032503$wgRightsIcon = null; 
     2504 
     2505/** 
     2506 * Set to an array of metadata terms. Else they will be loaded based on $wgRightsUrl 
     2507 */ 
     2508$wgLicenseTerms = false; 
    25042509 
    25052510/** Set this to some HTML to override the rights icon with an arbitrary logo */ 
     
    39823987 
    39833988/** 
    3984  * Break out of framesets. This can be used to prevent external sites from 
    3985  * framing your site with ads. 
     3989 * Break out of framesets. This can be used to prevent clickjacking attacks, 
     3990 * or to prevent external sites from framing your site with ads. 
    39863991 */ 
    39873992$wgBreakFrames = false; 
     3993 
     3994/** 
     3995 * The X-Frame-Options header to send on pages sensitive to clickjacking  
     3996 * attacks, such as edit pages. This prevents those pages from being displayed 
     3997 * in a frame or iframe. The options are: 
     3998 * 
     3999 *   - 'DENY': Do not allow framing. This is recommended for most wikis. 
     4000 * 
     4001 *   - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used 
     4002 *         to allow framing within a trusted domain. This is insecure if there 
     4003 *         is a page on the same domain which allows framing of arbitrary URLs. 
     4004 * 
     4005 *   - false: Allow all framing. This opens up the wiki to XSS attacks and thus  
     4006 *         full compromise of local user accounts. Private wikis behind a  
     4007 *         corporate firewall are especially vulnerable. This is not  
     4008 *         recommended. 
     4009 * 
     4010 * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages, 
     4011 * not just edit pages. 
     4012 */ 
     4013$wgEditPageFrameOptions = 'DENY'; 
    39884014 
    39894015/** 
  • trunk/w/includes/HTMLForm.php

    r1484 r1881  
    312312                } 
    313313 
     314                # For good measure (it is the default) 
     315                $wgOut->preventClickjacking(); 
     316 
    314317                $html = '' 
    315318                        . $this->mHeader 
  • trunk/w/includes/HistoryPage.php

    r1484 r1881  
    167167                        $pager->getNavigationBar() 
    168168                ); 
     169                $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); 
    169170 
    170171                wfProfileOut( __METHOD__ ); 
     
    302303        public $lastRow = false, $counter, $historyPage, $title, $buttons, $conds; 
    303304        protected $oldIdChecked; 
     305        protected $preventClickjacking = false; 
    304306 
    305307        function __construct( $historyPage, $year='', $month='', $tagFilter = '', $conds = array() ) { 
     
    383385                $this->buttons = '<div>'; 
    384386                if( $wgUser->isAllowed('deleterevision') ) { 
     387                        $this->preventClickjacking(); 
    385388                        $float = $wgContLang->alignEnd(); 
    386389                        # Note bug #20966, <button> is non-standard in IE<8 
     
    489492                // User can delete revisions... 
    490493                if( $wgUser->isAllowed( 'deleterevision' ) ) { 
     494                        $this->preventClickjacking(); 
    491495                        // If revision was hidden from sysops, disable the checkbox 
    492496                        if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { 
     
    535539                if( !is_null( $next ) && is_object( $next ) ) { 
    536540                        if( $latest && $this->title->userCan( 'rollback' ) && $this->title->userCan( 'edit' ) ) { 
     541                                $this->preventClickjacking(); 
    537542                                $tools[] = '<span class="mw-rollback-link">'. 
    538543                                        $this->getSkin()->buildRollbackLink( $rev ).'</span>'; 
     
    722727                } 
    723728        } 
     729 
     730        /** 
     731         * This is called if a write operation is possible from the generated HTML 
     732         */ 
     733        function preventClickjacking( $enable = true ) { 
     734                $this->preventClickjacking = $enable; 
     735        } 
     736 
     737        /** 
     738         * Get the "prevent clickjacking" flag 
     739         */ 
     740        function getPreventClickjacking() { 
     741                return $this->preventClickjacking; 
     742        } 
    724743} 
    725744 
  • trunk/w/includes/Html.php

    r1484 r1881  
    144144                $element = strtolower( $element ); 
    145145 
    146                 # Remove HTML5-only attributes if we aren't doing HTML5 
    147                 if ( !$wgHtml5 ) { 
    148                         if ( $element == 'input' ) { 
    149                                 # Whitelist of valid XHTML1 types 
    150                                 $validTypes = array( 
    151                                         'hidden', 
    152                                         'text', 
    153                                         'password', 
    154                                         'checkbox', 
    155                                         'radio', 
    156                                         'file', 
    157                                         'submit', 
    158                                         'image', 
    159                                         'reset', 
    160                                         'button', 
    161                                 ); 
    162                                 if ( isset( $attribs['type'] ) 
    163                                 && !in_array( $attribs['type'], $validTypes ) ) { 
    164                                         # Fall back to type=text, the default 
    165                                         unset( $attribs['type'] ); 
    166                                 } 
    167                         } 
    168                         if ( $element == 'textarea' && isset( $attribs['maxlength'] ) ) { 
    169                                 unset( $attribs['maxlength'] ); 
     146                # Remove HTML5-only attributes if we aren't doing HTML5, and disable 
     147                # form validation regardless (see bug 23769 and the more detailed 
     148                # comment in expandAttributes()) 
     149                if ( $element == 'input' ) { 
     150                        # Whitelist of types that don't cause validation.  All except 
     151                        # 'search' are valid in XHTML1. 
     152                        $validTypes = array( 
     153                                'hidden', 
     154                                'text', 
     155                                'password', 
     156                                'checkbox', 
     157                                'radio', 
     158                                'file', 
     159                                'submit', 
     160                                'image', 
     161                                'reset', 
     162                                'button', 
     163                                'search', 
     164                        ); 
     165                        if ( isset( $attribs['type'] ) 
     166                        && !in_array( $attribs['type'], $validTypes ) ) { 
     167                                unset( $attribs['type'] ); 
     168                        } 
     169                        if ( isset( $attribs['type'] ) && $attribs['type'] == 'search' 
     170                        && !$wgHtml5 ) { 
     171                                unset( $attribs['type'] ); 
    170172                        } 
    171173                        # Here we're blacklisting some HTML5-only attributes... 
     
    185187                                unset( $attribs[$badAttr] ); 
    186188                        } 
     189                } 
     190                if ( !$wgHtml5 && $element == 'textarea' && isset( $attribs['maxlength'] ) ) { 
     191                        unset( $attribs['maxlength'] ); 
    187192                } 
    188193 
     
    329334                        # and we'd like consistency and better compression anyway. 
    330335                        $key = strtolower( $key ); 
     336 
     337                        # Bug 23769: Blacklist all form validation attributes for now.  Current 
     338                        # (June 2010) WebKit has no UI, so the form just refuses to submit 
     339                        # without telling the user why, which is much worse than failing 
     340                        # server-side validation.  Opera is the only other implementation at 
     341                        # this time, and has ugly UI, so just kill the feature entirely until 
     342                        # we have at least one good implementation. 
     343                        if ( in_array( $key, array( 'max', 'min', 'pattern', 'required', 'step' ) ) ) { 
     344                                continue; 
     345                        } 
    331346 
    332347                        # See the "Attributes" section in the HTML syntax part of HTML5, 
  • trunk/w/includes/HttpFunctions.php

    r1484 r1881  
    715715                $this->curlOptions[CURLOPT_WRITEFUNCTION] = $this->callback; 
    716716                $this->curlOptions[CURLOPT_HEADERFUNCTION] = array($this, "readHeader"); 
    717                 $this->curlOptions[CURLOPT_FOLLOWLOCATION] = $this->followRedirects; 
    718717                $this->curlOptions[CURLOPT_MAXREDIRS] = $this->maxRedirects; 
    719718 
     
    749748 
    750749                $curlHandle = curl_init( $this->url ); 
    751                 curl_setopt_array( $curlHandle, $this->curlOptions ); 
     750                if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) { 
     751                        throw new MWException("Error setting curl options."); 
     752                } 
     753                if ( ! @curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, $this->followRedirects ) ) { 
     754                        wfDebug("Couldn't set CURLOPT_FOLLOWLOCATION. Probably safe_mode or open_basedir is set."); 
     755                        /* Continue the processing. If it were in curl_setopt_array, processing would have halted on its entry */ 
     756                } 
    752757 
    753758                if ( false === curl_exec( $curlHandle ) ) { 
  • trunk/w/includes/ImagePage.php

    r1484 r1881  
    601601                $pager = new ImageHistoryPseudoPager( $this ); 
    602602                $wgOut->addHTML( $pager->getBody() ); 
     603                $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); 
    603604 
    604605                $this->img->resetHistory(); // free db resources 
     
    804805 
    805806        protected $imagePage, $img, $skin, $title, $repo, $showThumb; 
     807        protected $preventClickjacking = false; 
    806808 
    807809        public function __construct( $imagePage ) { 
     
    930932                        $row .= '<span class="history-deleted">' . $wgLang->timeAndDate( $timestamp, true ) . '</span>'; 
    931933                } elseif( $file->isDeleted(File::DELETED_FILE) ) { 
     934                        $this->preventClickjacking(); 
    932935                        $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); 
    933936                        # Make a link to review the image 
     
    10161019                } 
    10171020        } 
     1021 
     1022        protected function preventClickjacking( $enable = true ) { 
     1023                $this->preventClickjacking = $enable; 
     1024        } 
     1025 
     1026        public function getPreventClickjacking() { 
     1027                return $this->preventClickjacking; 
     1028        } 
    10181029} 
    10191030 
    10201031class ImageHistoryPseudoPager extends ReverseChronologicalPager { 
     1032        protected $preventClickjacking = false; 
     1033 
    10211034        function __construct( $imagePage ) { 
    10221035                parent::__construct(); 
     
    10591072                        } 
    10601073                        $s .= $list->endImageHistoryList($navLink); 
     1074 
     1075                        if ( $list->getPreventClickjacking() ) { 
     1076                                $this->preventClickjacking(); 
     1077                        } 
    10611078                } 
    10621079                return $s; 
     
    11411158                $this->mQueryDone = true; 
    11421159        } 
     1160         
     1161        protected function preventClickjacking( $enable = true ) { 
     1162                $this->preventClickjacking = $enable; 
     1163        } 
     1164 
     1165        public function getPreventClickjacking() { 
     1166                return $this->preventClickjacking; 
     1167        } 
     1168 
    11431169} 
  • trunk/w/includes/OutputHandler.php

    r1484 r1881  
    9191        if ( !$foundVary ) { 
    9292                header( 'Vary: Accept-Encoding' ); 
    93                 header( 'X-Vary-Options: Accept-Encoding;list-contains=gzip' ); 
     93                global $wgUseXVO; 
     94                if ( $wgUseXVO ) { 
     95                        header( 'X-Vary-Options: Accept-Encoding;list-contains=gzip' ); 
     96                } 
    9497        } 
    9598        return $s; 
  • trunk/w/includes/OutputPage.php

    r1570 r1881  
    3838        var $mParseWarnings = array(); 
    3939        var $mSquidMaxage = 0; 
     40        var $mPreventClickjacking = true; 
    4041        var $mRevisionId = null; 
    4142        protected $mTitle = null; 
     
    12671268                foreach ( $cvCookies as $cookieName ) { 
    12681269                        # Check for a simple string match, like the way squid does it 
    1269                         if ( strpos( $cookieHeader, $cookieName ) ) { 
     1270                        if ( strpos( $cookieHeader, $cookieName ) !== false ) { 
    12701271                                wfDebug( __METHOD__.": found $cookieName\n" ); 
    12711272                                return true; 
     
    13451346                        } 
    13461347                        $this->addVaryHeader( 'Accept-Language', $aloption ); 
     1348                } 
     1349        } 
     1350 
     1351        /** 
     1352         * Set a flag which will cause an X-Frame-Options header appropriate for  
     1353         * edit pages to be sent. The header value is controlled by  
     1354         * $wgEditPageFrameOptions. 
     1355         * 
     1356         * This is the default for special pages. If you display a CSRF-protected  
     1357         * form on an ordinary view page, then you need to call this function. 
     1358         */ 
     1359        public function preventClickjacking( $enable = true ) { 
     1360                $this->mPreventClickjacking = $enable; 
     1361        } 
     1362 
     1363        /** 
     1364         * Turn off frame-breaking. Alias for $this->preventClickjacking(false). 
     1365         * This can be called from pages which do not contain any CSRF-protected 
     1366         * HTML form. 
     1367         */ 
     1368        public function allowClickjacking() { 
     1369                $this->mPreventClickjacking = false; 
     1370        } 
     1371 
     1372        /** 
     1373         * Get the X-Frame-Options header value (without the name part), or false  
     1374         * if there isn't one. This is used by Skin to determine whether to enable  
     1375         * JavaScript frame-breaking, for clients that don't support X-Frame-Options. 
     1376         */ 
     1377        public function getFrameOptions() { 
     1378                global $wgBreakFrames, $wgEditPageFrameOptions; 
     1379                if ( $wgBreakFrames ) { 
     1380                        return 'DENY'; 
     1381                } elseif ( $this->mPreventClickjacking && $wgEditPageFrameOptions ) { 
     1382                        return $wgEditPageFrameOptions; 
    13471383                } 
    13481384        } 
     
    15621598                $wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode ); 
    15631599 
     1600                // Prevent framing, if requested 
     1601                $frameOptions = $this->getFrameOptions(); 
     1602                if ( $frameOptions ) { 
     1603                        $wgRequest->response()->header( "X-Frame-Options: $frameOptions" ); 
     1604                } 
     1605 
     1606 
    15641607                if ($this->mArticleBodyOnly) { 
    15651608                        $this->out($this->mBodytext); 
  • trunk/w/includes/Sanitizer.php

    r1570 r1881  
    741741                $value = StringUtils::delimiterReplace( '/*', '*/', ' ', $value ); 
    742742 
     743                // Remove anything after a comment-start token, to guard against 
     744                // incorrect client implementations. 
     745                $commentPos = strpos( $value, '/*' ); 
     746                if ( $commentPos !== false ) { 
     747                        $value = substr( $value, 0, $commentPos ); 
     748                } 
     749 
    743750                // Decode escape sequences and line continuation 
    744751                // See the grammar in the CSS 2 spec, appendix D. 
  • trunk/w/includes/Skin.php

    r1570 r1881  
    414414                        'wgUserLanguage' => $wgLang->getCode(), 
    415415                        'wgContentLanguage' => $wgContLang->getCode(), 
    416                         'wgBreakFrames' => $wgBreakFrames, 
     416                        'wgBreakFrames' => $wgOut->getFrameOptions() == 'DENY', 
    417417                        'wgCurRevisionId' => isset( $wgArticle ) ? $wgArticle->getLatest() : 0, 
    418418                        'wgVersion' => $wgVersion, 
     
    20832083 
    20842084                $bar = array(); 
    2085                 $this->addToSidebar( $bar, wfMsgForContentNoTrans( 'sidebar' ) ); 
     2085                $this->addToSidebar( $bar, 'sidebar' ); 
    20862086 
    20872087                wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) ); 
     
    20922092                return $bar; 
    20932093        } 
    2094          
    2095         /** 
    2096          * Add content to the sidebar from text 
    2097          * @since 1.16 
     2094        /** 
     2095         * Add content from a sidebar system message 
     2096         * Currently only used for MediaWiki:Sidebar (but may be used by Extensions) 
     2097         * 
    20982098         * @param &$bar array 
    2099          * @param $text string 
    2100          *  
    2101          * @return array 
    2102          */ 
    2103         function addToSidebar( &$bar, $text ) { 
    2104                 $lines = explode( "\n", $text ); 
     2099         * @param $message String 
     2100         */ 
     2101        function addToSidebar( &$bar, $message ) { 
     2102                $lines = explode( "\n", wfMsgForContent( $message ) ); 
    21052103                $heading = ''; 
    21062104                foreach( $lines as $line ) { 
     
    21152113                        } else { 
    21162114                                if( strpos( $line, '|' ) !== false ) { // sanity check 
    2117                                         global $wgMessageCache; 
    2118                                         $line = $wgMessageCache->transform( $line ); 
    2119                                          
    21202115                                        $line = array_map( 'trim', explode( '|', trim( $line, '* ' ), 2 ) ); 
    21212116                                        $link = wfMsgForContent( $line[0] ); 
  • trunk/w/includes/StringUtils.php

    r1484 r1881  
    7878 
    7979                        if ( $tokenType == 'start' ) { 
    80                                 $inputPos = $tokenOffset + $tokenLength; 
    8180                                # Only move the start position if we haven't already found a start 
    8281                                # This means that START START END matches outer pair 
    8382                                if ( !$foundStart ) { 
    8483                                        # Found start 
     84                                        $inputPos = $tokenOffset + $tokenLength; 
    8585                                        # Write out the non-matching section 
    8686                                        $output .= substr( $subject, $outputPos, $tokenOffset - $outputPos ); 
     
    8888                                        $contentPos = $inputPos; 
    8989                                        $foundStart = true; 
     90                                } else { 
     91                                        # Move the input position past the *first character* of START, 
     92                                        # to protect against missing END when it overlaps with START 
     93                                        $inputPos = $tokenOffset + 1; 
    9094                                } 
    9195                        } elseif ( $tokenType == 'end' ) { 
  • trunk/w/includes/StubObject.php

    r1484 r1881  
    153153 
    154154                # Validate $code 
    155                 if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) || ( $code === 'qqq' ) ) { 
     155                if( empty( $code ) || !Language::isValidCode( $code ) || ( $code === 'qqq' ) ) { 
    156156                        wfDebug( "Invalid user language code\n" ); 
    157157                        $code = $wgContLanguageCode; 
  • trunk/w/includes/Title.php

    r1484 r1881  
    26072607                if($wgContLang->hasVariants()){ 
    26082608                        $variants = $wgContLang->getVariants(); 
    2609                         foreach($variants as $vCode){ 
    2610                                 if($vCode==$wgContLang->getCode()) continue; // we don't want default variant 
    2611                                 $urls[] = $this->getInternalURL('',$vCode); 
     2609                        foreach ( $variants as $vCode ) { 
     2610                                $urls[] = $this->getInternalURL( '', $vCode ); 
    26122611                        } 
    26132612                } 
  • trunk/w/includes/WebRequest.php

    r1484 r1881  
    437437         */ 
    438438        public function getRequestURL() { 
    439                 if( isset( $_SERVER['REQUEST_URI'] ) ) { 
     439                if( isset( $_SERVER['REQUEST_URI']) && strlen($_SERVER['REQUEST_URI']) ) { 
    440440                        $base = $_SERVER['REQUEST_URI']; 
    441441                } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) { 
  • trunk/w/includes/api/ApiBase.php

    r1570 r1881  
    5858 
    5959        private $mMainModule, $mModuleName, $mModulePrefix; 
     60        private $mParamCache = array(); 
    6061 
    6162        /** 
     
    473474         */ 
    474475        public function extractRequestParams( $parseLimit = true ) { 
    475                 $params = $this->getFinalParams(); 
    476                 $results = array(); 
    477  
    478                 if ( $params ) { // getFinalParams() can return false 
    479                         foreach ( $params as $paramName => $paramSettings ) { 
    480                                 $results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit ); 
    481                         } 
    482                 } 
    483  
    484                 return $results; 
     476                // Cache parameters, for performance and to avoid bug 24564. 
     477                if ( !isset( $this->mParamCache[$parseLimit] ) ) { 
     478                        $params = $this->getFinalParams(); 
     479                        $results = array(); 
     480 
     481                        if ( $params ) { // getFinalParams() can return false 
     482                                foreach ( $params as $paramName => $paramSettings ) { 
     483                                        $results[$paramName] = $this->getParameterFromSettings(  
     484                                                $paramName, $paramSettings, $parseLimit ); 
     485                                } 
     486                        } 
     487                        $this->mParamCache[$parseLimit] = $results; 
     488                } 
     489                return $this->mParamCache[$parseLimit]; 
    485490        } 
    486491 
     
    10021007 
    10031008        /** 
     1009         * Returns whether this module requires a Token to execute 
     1010         * @returns bool 
     1011         */ 
     1012        public function needsToken() { 
     1013                return false; 
     1014        } 
     1015 
     1016        /** 
    10041017         * Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token 
    10051018         * @returns bool 
     
    10291042                } 
    10301043 
    1031                 if ( $this->getTokenSalt() !== false ) { 
     1044                if ( $this->needsToken() ) { 
    10321045                        $ret[] = array( 'missingparam', 'token' ); 
    10331046                        $ret[] = array( 'sessionfailure' ); 
     
    11801193         */ 
    11811194        public static function getBaseVersion() { 
    1182                 return __CLASS__ . ': $Id: ApiBase.php 65319 2010-04-20 14:19:12Z demon $'; 
     1195                return __CLASS__ . ': $Id: ApiBase.php 79562 2011-01-04 06:15:54Z tstarling $'; 
    11831196        } 
    11841197} 
  • trunk/w/includes/api/ApiBlock.php

    r1484 r1881  
    176176        } 
    177177         
     178        public function needsToken() { 
     179                return true; 
     180        } 
     181 
    178182        public function getTokenSalt() { 
    179183                return ''; 
     
    188192 
    189193        public function getVersion() { 
    190                 return __CLASS__ . ': $Id: ApiBlock.php 62766 2010-02-21 12:32:46Z ashley $'; 
     194                return __CLASS__ . ': $Id: ApiBlock.php 74217 2010-10-03 15:53:07Z reedy $'; 
    191195        } 
    192196} 
  • trunk/w/includes/api/ApiDelete.php

    r1484 r1881  
    231231        } 
    232232 
     233        public function needsToken() { 
     234                return true; 
     235        } 
     236 
    233237        public function getTokenSalt() { 
    234238                return ''; 
     
    243247 
    244248        public function getVersion() { 
    245                 return __CLASS__ . ': $Id: ApiDelete.php 62703 2010-02-19 12:54:09Z ashley $'; 
     249                return __CLASS__ . ': $Id: ApiDelete.php 74217 2010-10-03 15:53:07Z reedy $'; 
    246250        } 
    247251} 
  • trunk/w/includes/api/ApiEditPage.php

    r1484 r1881  
    455455        } 
    456456         
     457        public function needsToken() { 
     458                return true; 
     459        } 
     460 
    457461        public function getTokenSalt() { 
    458462                return ''; 
     
    471475 
    472476        public function getVersion() { 
    473                 return __CLASS__ . ': $Id: ApiEditPage.php 62600 2010-02-16 22:01:38Z reedy $'; 
     477                return __CLASS__ . ': $Id: ApiEditPage.php 74217 2010-10-03 15:53:07Z reedy $'; 
    474478        } 
    475479} 
  • trunk/w/includes/api/ApiEmailUser.php

    r1484 r1881  
    113113        } 
    114114         
     115        public function needsToken() { 
     116                return true; 
     117        } 
     118 
    115119        public function getTokenSalt() { 
    116120                return ''; 
     
    124128 
    125129        public function getVersion() { 
    126                 return __CLASS__ . ': $Id: ApiEmailUser.php 62599 2010-02-16 21:59:16Z reedy $'; 
     130                return __CLASS__ . ': $Id: ApiEmailUser.php 74217 2010-10-03 15:53:07Z reedy $'; 
    127131        } 
    128132} 
  • trunk/w/includes/api/ApiExpandTemplates.php

    r1484 r1881  
    4343 
    4444        public function execute() { 
     45                // Cache may vary on $wgUser because ParserOptions gets data from it 
     46                $this->getMain()->setCacheMode( 'anon-public-user-private' ); 
     47 
    4548                // Get parameters 
    4649                $params = $this->extractRequestParams(); 
     
    107110 
    108111        public function getVersion() { 
    109                 return __CLASS__ . ': $Id: ApiExpandTemplates.php 61437 2010-01-23 22:26:40Z reedy $'; 
     112                return __CLASS__ . ': $Id: ApiExpandTemplates.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    110113        } 
    111114} 
  • trunk/w/includes/api/ApiFeedWatchlist.php

    r1484 r1881  
    192192 
    193193        public function getVersion() { 
    194                 return __CLASS__ . ': $Id: ApiFeedWatchlist.php 62686 2010-02-19 01:25:57Z reedy $'; 
     194                return __CLASS__ . ': $Id: ApiFeedWatchlist.php 69357 2010-07-14 22:39:23Z mah $'; 
    195195        } 
    196196} 
  • trunk/w/includes/api/ApiImport.php

    r1484 r1881  
    150150        } 
    151151         
     152        public function needsToken() { 
     153                return true; 
     154        } 
     155 
    152156        public function getTokenSalt() { 
    153157                return ''; 
     
    162166 
    163167        public function getVersion() { 
    164                 return __CLASS__ . ': $Id: ApiImport.php 62599 2010-02-16 21:59:16Z reedy $'; 
     168                return __CLASS__ . ': $Id: ApiImport.php 74217 2010-10-03 15:53:07Z reedy $'; 
    165169        } 
    166170} 
  • trunk/w/includes/api/ApiLogout.php

    r1484 r1881  
    7676 
    7777        public function getVersion() { 
    78                 return __CLASS__ . ': $Id: ApiLogout.php 60930 2010-01-11 15:55:52Z simetrical $'; 
     78                return __CLASS__ . ': $Id: ApiLogout.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    7979        } 
    8080} 
  • trunk/w/includes/api/ApiMain.php

    r1484 r1881  
    127127        private $mInternalMode, $mSquidMaxage, $mModule; 
    128128 
    129         private $mCacheControl = array( 'must-revalidate' => true ); 
     129        private $mCacheMode = 'private'; 
     130        private $mCacheControl = array(); 
    130131 
    131132        /** 
     
    224225 
    225226        /** 
     227         * Set the type of caching headers which will be sent. 
     228         * 
     229         * @param $mode One of: 
     230         *    - 'public':     Cache this object in public caches, if the maxage or smaxage  
     231         *         parameter is set, or if setCacheMaxAge() was called. If a maximum age is 
     232         *         not provided by any of these means, the object will be private. 
     233         *    - 'private':    Cache this object only in private client-side caches. 
     234         *    - 'anon-public-user-private': Make this object cacheable for logged-out 
     235         *         users, but private for logged-in users. IMPORTANT: If this is set, it must be  
     236         *         set consistently for a given URL, it cannot be set differently depending on  
     237         *         things like the contents of the database, or whether the user is logged in. 
     238         * 
     239         *  If the wiki does not allow anonymous users to read it, the mode set here 
     240         *  will be ignored, and private caching headers will always be sent. In other words,  
     241         *  the "public" mode is equivalent to saying that the data sent is as public as a page 
     242         *  view. 
     243         * 
     244         *  For user-dependent data, the private mode should generally be used. The  
     245         *  anon-public-user-private mode should only be used where there is a particularly  
     246         *  good performance reason for caching the anonymous response, but where the 
     247         *  response to logged-in users may differ, or may contain private data.  
     248         * 
     249         *  If this function is never called, then the default will be the private mode. 
     250         */ 
     251        public function setCacheMode( $mode ) { 
     252                if ( !in_array( $mode, array( 'private', 'public', 'anon-public-user-private' ) ) ) { 
     253                        wfDebug( __METHOD__.": unrecognised cache mode \"$mode\"\n" ); 
     254                        // Ignore for forwards-compatibility 
     255                        return; 
     256                } 
     257 
     258                if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) { 
     259                        // Private wiki, only private headers 
     260                        if ( $mode !== 'private' ) { 
     261                                wfDebug( __METHOD__.": ignoring request for $mode cache mode, private wiki\n" ); 
     262                                return; 
     263                        } 
     264                } 
     265 
     266                wfDebug( __METHOD__.": setting cache mode $mode\n" ); 
     267                $this->mCacheMode = $mode; 
     268        } 
     269         
     270        /** 
     271         * @deprecated Private caching is now the default, so there is usually no  
     272         * need to call this function. If there is a need, you can use  
     273         * $this->setCacheMode('private') 
     274         */ 
     275        public function setCachePrivate() { 
     276                $this->setCacheMode( 'private' ); 
     277        } 
     278 
     279        /** 
    226280         * Set directives (key/value pairs) for the Cache-Control header. 
    227281         * Boolean values will be formatted as such, by including or omitting 
    228282         * without an equals sign. 
     283         * 
     284         * Cache control values set here will only be used if the cache mode is not  
     285         * private, see setCacheMode(). 
    229286         */ 
    230287        public function setCacheControl( $directives ) { 
    231288                $this->mCacheControl = $directives + $this->mCacheControl; 
     289        } 
     290         
     291        /** 
     292         * Make sure Vary: Cookie and friends are set. Use this when the output of a request 
     293         * may be cached for anons but may not be cached for logged-in users. 
     294         * 
     295         * WARNING: This function must be called CONSISTENTLY for a given URL. This means that a 
     296         * given URL must either always or never call this function; if it sometimes does and 
     297         * sometimes doesn't, stuff will break. 
     298         * 
     299         * @deprecated Use setCacheMode( 'anon-public-user-private' ) 
     300         */ 
     301        public function setVaryCookie() { 
     302                $this->setCacheMode( 'anon-public-user-private' ); 
    232303        } 
    233304 
     
    281352 
    282353                        // Error results should not be cached 
    283                         $this->setCacheMaxAge( 0 ); 
     354                        $this->setCacheMode( 'private' ); 
    284355 
    285356                        $headerStr = 'MediaWiki-API-Error: ' . $errCode; 
     
    297368                } 
    298369 
     370                // Send cache headers after any code which might generate an error, to  
     371                // avoid sending public cache headers for errors. 
     372                $this->sendCacheHeaders(); 
     373 
     374                if ( $this->mPrinter->getIsHtml() ) { 
     375                        echo wfReportTime(); 
     376                } 
     377 
     378                ob_end_flush(); 
     379        } 
     380 
     381        protected function sendCacheHeaders() { 
     382                if ( $this->mCacheMode == 'private' ) { 
     383                        header( 'Cache-Control: private' ); 
     384                        return; 
     385                } 
     386 
     387                if ( $this->mCacheMode == 'anon-public-user-private' ) { 
     388                        global $wgUseXVO, $wgOut; 
     389                        header( 'Vary: Accept-Encoding, Cookie' ); 
     390                        if ( $wgUseXVO ) { 
     391                                header( $wgOut->getXVO() ); 
     392                                if ( $wgOut->haveCacheVaryCookies() ) { 
     393                                        // Logged in, mark this request private 
     394                                        header( 'Cache-Control: private' ); 
     395                                        return; 
     396                                } 
     397                                // Logged out, send normal public headers below 
     398                        } elseif ( session_id() != '' ) { 
     399                                // Logged in or otherwise has session (e.g. anonymous users who have edited) 
     400                                // Mark request private 
     401                                header( 'Cache-Control: private' ); 
     402                                return; 
     403                        } // else no XVO and anonymous, send public headers below 
     404                } else /* if public */ { 
     405                        // Give a debugging message if the user object is unstubbed on a public request 
     406                        global $wgUser; 
     407                        if ( !( $wgUser instanceof StubUser ) ) { 
     408                                wfDebug( __METHOD__." \$wgUser is unstubbed on a public request!\n" ); 
     409                        } 
     410                } 
     411 
    299412                // If nobody called setCacheMaxAge(), use the (s)maxage parameters 
    300413                if ( !isset( $this->mCacheControl['s-maxage'] ) ) { 
     
    305418                } 
    306419 
    307                 // Set the cache expiration at the last moment, as any errors may change the expiration. 
    308                 // if $this->mSquidMaxage == 0, the expiry time is set to the first second of unix epoch 
    309                 $exp = min( $this->mCacheControl['s-maxage'], $this->mCacheControl['max-age'] ); 
    310                 $expires = ( $exp == 0 ? 1 : time() + $exp ); 
    311                 header( 'Expires: ' . wfTimestamp( TS_RFC2822, $expires ) ); 
     420                if ( !$this->mCacheControl['s-maxage'] && !$this->mCacheControl['max-age'] ) { 
     421                        // Public cache not requested 
     422                        // Sending a Vary header in this case is harmless, and protects us 
     423                        // against conditional calls of setCacheMaxAge(). 
     424                        header( 'Cache-Control: private' ); 
     425                        return; 
     426                } 
     427 
     428                $this->mCacheControl['public'] = true; 
     429 
     430                // Send an Expires header 
     431                $maxAge = min( $this->mCacheControl['s-maxage'], $this->mCacheControl['max-age'] ); 
     432                $expiryUnixTime = ( $maxAge == 0 ? 1 : time() + $maxAge ); 
     433                header( 'Expires: ' . wfTimestamp( TS_RFC2822, $expiryUnixTime ) ); 
    312434 
    313435                // Construct the Cache-Control header 
     
    327449                         
    328450                header( "Cache-Control: $ccHeader" ); 
    329  
    330                 if ( $this->mPrinter->getIsHtml() ) 
    331                         echo wfReportTime(); 
    332  
    333                 ob_end_flush(); 
    334451        } 
    335452 
     
    447564 
    448565                global $wgUser, $wgGroupPermissions; 
    449                 if ( $module->isReadMode() && !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) ) 
     566                if ( $module->isReadMode() && !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) && !$wgUser->isAllowed( 'read' ) ) 
    450567                        $this->dieUsageMsg( array( 'readrequired' ) ); 
    451568                if ( $module->isWriteMode() ) { 
     
    742859                $vers = array (); 
    743860                $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n    http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/"; 
    744                 $vers[] = __CLASS__ . ': $Id: ApiMain.php 62810 2010-02-22 03:34:56Z mah $'; 
     861                $vers[] = __CLASS__ . ': $Id: ApiMain.php 70066 2010-07-28 05:52:32Z tstarling $'; 
    745862                $vers[] = ApiBase :: getBaseVersion(); 
    746863                $vers[] = ApiFormatBase :: getBaseVersion(); 
  • trunk/w/includes/api/ApiMove.php

    r1484 r1881  
    220220        } 
    221221 
     222        public function needsToken() { 
     223                return true; 
     224        } 
     225 
    222226        public function getTokenSalt() { 
    223227                return ''; 
     
    231235 
    232236        public function getVersion() { 
    233                 return __CLASS__ . ': $Id: ApiMove.php 62810 2010-02-22 03:34:56Z mah $'; 
     237                return __CLASS__ . ': $Id: ApiMove.php 74217 2010-10-03 15:53:07Z reedy $'; 
    234238        } 
    235239} 
  • trunk/w/includes/api/ApiOpenSearch.php

    r1484 r1881  
    5757                        // time 
    5858                        $this->getMain()->setCacheMaxAge( $wgSearchSuggestCacheExpiry ); 
    59                         $this->getMain()->setCacheControl( array( 'must-revalidate' => false ) ); 
     59                        $this->getMain()->setCacheMode( 'public' ); 
    6060 
    6161                        $srchres = PrefixSearch::titleSearch( $search, $limit, 
     
    107107 
    108108        public function getVersion() { 
    109                 return __CLASS__ . ': $Id: ApiOpenSearch.php 62544 2010-02-15 20:42:43Z catrope $'; 
     109                return __CLASS__ . ': $Id: ApiOpenSearch.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    110110        } 
    111111} 
  • trunk/w/includes/api/ApiParse.php

    r1484 r1881  
    3939 
    4040        public function execute() { 
     41                // The data is hot but user-dependent, like page views, so we set vary cookies 
     42                $this->getMain()->setCacheMode( 'anon-public-user-private' ); 
     43 
    4144                // Get parameters 
    4245                $params = $this->extractRequestParams(); 
     
    324327 
    325328        public function getVersion() { 
    326                 return __CLASS__ . ': $Id: ApiParse.php 62712 2010-02-19 18:28:52Z reedy $'; 
     329                return __CLASS__ . ': $Id: ApiParse.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    327330        } 
    328331} 
  • trunk/w/includes/api/ApiPatrol.php

    r1484 r1881  
    9393        } 
    9494         
     95        public function needsToken() { 
     96                return true; 
     97        } 
     98 
    9599        public function getTokenSalt() { 
    96100                return ''; 
     
    104108 
    105109        public function getVersion() { 
    106                 return __CLASS__ . ': $Id: ApiPatrol.php 62599 2010-02-16 21:59:16Z reedy $'; 
     110                return __CLASS__ . ': $Id: ApiPatrol.php 74217 2010-10-03 15:53:07Z reedy $'; 
    107111        } 
    108112} 
  • trunk/w/includes/api/ApiProtect.php

    r1484 r1881  
    185185        } 
    186186         
     187        public function needsToken() { 
     188                return true; 
     189        } 
     190 
    187191        public function getTokenSalt() { 
    188                 return null; 
     192                return ''; 
    189193        } 
    190194 
     
    197201 
    198202        public function getVersion() { 
    199                 return __CLASS__ . ': $Id: ApiProtect.php 62557 2010-02-15 23:53:43Z reedy $'; 
     203                return __CLASS__ . ': $Id: ApiProtect.php 74217 2010-10-03 15:53:07Z reedy $'; 
    200204        } 
    201205} 
  • trunk/w/includes/api/ApiPurge.php

    r1484 r1881  
    118118 
    119119        public function getVersion() { 
    120                 return __CLASS__ . ': $Id: ApiPurge.php 62402 2010-02-13 00:09:05Z reedy $'; 
     120                return __CLASS__ . ': $Id: ApiPurge.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    121121        } 
    122122} 
  • trunk/w/includes/api/ApiQuery.php

    r1484 r1881  
    207207                $this->InstantiateModules( $modules, 'meta', $this->mQueryMetaModules ); 
    208208 
     209                $cacheMode = 'public'; 
     210 
    209211                // If given, execute generator to substitute user supplied data with generated data. 
    210212                if ( isset ( $this->params['generator'] ) ) { 
    211                         $this->executeGeneratorModule( $this->params['generator'], $modules ); 
     213                        $generator = $this->newGenerator( $this->params['generator'] ); 
     214                        $params = $generator->extractRequestParams(); 
     215                        $cacheMode = $this->mergeCacheMode( $cacheMode,  
     216                                $generator->getCacheMode( $params ) ); 
     217                        $this->executeGeneratorModule( $generator, $modules ); 
    212218                } else { 
    213219                        // Append custom fields and populate page/revision information 
     
    221227                // Execute all requested modules. 
    222228                foreach ( $modules as $module ) { 
     229                        $params = $module->extractRequestParams(); 
     230                        $cacheMode = $this->mergeCacheMode(  
     231                                $cacheMode, $module->getCacheMode( $params ) ); 
    223232                        $module->profileIn(); 
    224233                        $module->execute(); 
     
    226235                        $module->profileOut(); 
    227236                } 
     237 
     238                // Set the cache mode 
     239                $this->getMain()->setCacheMode( $cacheMode ); 
     240        } 
     241 
     242        /** 
     243         * Update a cache mode string, applying the cache mode of a new module to it. 
     244         * The cache mode may increase in the level of privacy, but public modules  
     245         * added to private data do not decrease the level of privacy. 
     246         */ 
     247        protected function mergeCacheMode( $cacheMode, $modCacheMode ) { 
     248                if ( $modCacheMode === 'anon-public-user-private' ) { 
     249                        if ( $cacheMode !== 'private' ) { 
     250                                $cacheMode = 'anon-public-user-private'; 
     251                        } 
     252                } elseif ( $modCacheMode === 'public' ) { 
     253                        // do nothing, if it's public already it will stay public 
     254                } else { // private 
     255                        $cacheMode = 'private'; 
     256                } 
     257                return $cacheMode; 
    228258        } 
    229259 
     
    402432 
    403433        /** 
    404          * For generator mode, execute generator, and use its output as new 
    405          * ApiPageSet 
    406          * @param $generatorName string Module name 
    407          * @param $modules array of module objects 
    408          */ 
    409         protected function executeGeneratorModule( $generatorName, $modules ) { 
     434         * Create a generator object of the given type and return it 
     435         */ 
     436        public function newGenerator( $generatorName ) { 
    410437 
    411438                // Find class that implements requested generator 
     
    425452                if ( !$generator instanceof ApiQueryGeneratorBase ) 
    426453                        $this->dieUsage( "Module $generatorName cannot be used as a generator", "badgenerator" ); 
    427  
    428454                $generator->setGeneratorMode(); 
     455                return $generator; 
     456        } 
     457 
     458        /** 
     459         * For generator mode, execute generator, and use its output as new 
     460         * ApiPageSet 
     461         * @param $generatorName string Module name 
     462         * @param $modules array of module objects 
     463         */ 
     464        protected function executeGeneratorModule( $generator, $modules ) { 
     465                // Generator results 
     466                $resultPageSet = new ApiPageSet( $this, $this->redirects, $this->convertTitles ); 
    429467 
    430468                // Add any additional fields modules may need 
     
    579617                $psModule = new ApiPageSet( $this ); 
    580618                $vers = array (); 
    581                 $vers[] = __CLASS__ . ': $Id: ApiQuery.php 62406 2010-02-13 00:48:31Z reedy $'; 
     619                $vers[] = __CLASS__ . ': $Id: ApiQuery.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    582620                $vers[] = $psModule->getVersion(); 
    583621                return $vers; 
  • trunk/w/includes/api/ApiQueryAllCategories.php

    r1484 r1881  
    4343        public function execute() { 
    4444                $this->run(); 
     45        } 
     46 
     47        public function getCacheMode( $params ) { 
     48                return 'public'; 
    4549        } 
    4650 
     
    176180 
    177181        public function getVersion() { 
    178                 return __CLASS__ . ': $Id: ApiQueryAllCategories.php 60930 2010-01-11 15:55:52Z simetrical $'; 
     182                return __CLASS__ . ': $Id: ApiQueryAllCategories.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    179183        } 
    180184} 
  • trunk/w/includes/api/ApiQueryAllLinks.php

    r1484 r1881  
    4242        public function execute() { 
    4343                $this->run(); 
     44        } 
     45 
     46        public function getCacheMode( $params ) { 
     47                return 'public'; 
    4448        } 
    4549 
     
    206210 
    207211        public function getVersion() { 
    208                 return __CLASS__ . ': $Id: ApiQueryAllLinks.php 62409 2010-02-13 01:05:14Z reedy $'; 
     212                return __CLASS__ . ': $Id: ApiQueryAllLinks.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    209213        } 
    210214} 
  • trunk/w/includes/api/ApiQueryAllUsers.php

    r1570 r1881  
    185185                } 
    186186 
    187                 $db->freeResult( $res ); 
     187                if ( is_array( $lastUserData ) ) { 
     188                        $fit = $result->addValue( array( 'query', $this->getModuleName() ), 
     189                                        null, $lastUserData ); 
     190                        if ( !$fit ) { 
     191                                $this->setContinueEnumParameter( 'from', 
     192                                                $this->keyToTitle( $lastUserData['name'] ) ); 
     193                        } 
     194                } 
    188195 
    189196                $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'u' ); 
     197        } 
     198 
     199        public function getCacheMode( $params ) { 
     200                return 'public'; 
    190201        } 
    191202 
     
    241252 
    242253        public function getVersion() { 
    243                 return __CLASS__ . ': $Id: ApiQueryAllUsers.php 66947 2010-05-27 07:42:20Z tstarling $'; 
     254                return __CLASS__ . ': $Id: ApiQueryAllUsers.php 79562 2011-01-04 06:15:54Z tstarling $'; 
    244255        } 
    245256} 
  • trunk/w/includes/api/ApiQueryAllimages.php

    r1484 r1881  
    5454        public function execute() { 
    5555                $this->run(); 
     56        } 
     57 
     58        public function getCacheMode( $params ) { 
     59                return 'public'; 
    5660        } 
    5761 
     
    213217 
    214218        public function getVersion() { 
    215                 return __CLASS__ . ': $Id: ApiQueryAllimages.php 62406 2010-02-13 00:48:31Z reedy $'; 
     219                return __CLASS__ . ': $Id: ApiQueryAllimages.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    216220        } 
    217221} 
  • trunk/w/includes/api/ApiQueryAllmessages.php

    r1484 r1881  
    121121        } 
    122122 
     123        public function getCacheMode( $params ) { 
     124                if ( is_null( $params['lang'] ) ) { 
     125                        // Language not specified, will be fetched from preferences 
     126                        return 'anon-public-user-private'; 
     127                } elseif ( $params['enableparser'] ) { 
     128                        // User-specific parser options will be used 
     129                        return 'anon-public-user-private'; 
     130                } else { 
     131                        // OK to cache 
     132                        return 'public'; 
     133                } 
     134        } 
     135 
    123136        public function getAllowedParams() { 
    124137                return array ( 
     
    168181 
    169182        public function getVersion() { 
    170                 return __CLASS__ . ': $Id: ApiQueryAllmessages.php 62535 2010-02-15 18:47:32Z catrope $'; 
     183                return __CLASS__ . ': $Id: ApiQueryAllmessages.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    171184        } 
    172185} 
  • trunk/w/includes/api/ApiQueryAllpages.php

    r1484 r1881  
    4242        public function execute() { 
    4343                $this->run(); 
     44        } 
     45 
     46        public function getCacheMode( $params ) { 
     47                return 'public'; 
    4448        } 
    4549 
     
    283287 
    284288        public function getVersion() { 
    285                 return __CLASS__ . ': $Id: ApiQueryAllpages.php 62406 2010-02-13 00:48:31Z reedy $'; 
     289                return __CLASS__ . ': $Id: ApiQueryAllpages.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    286290        } 
    287291} 
  • trunk/w/includes/api/ApiQueryBacklinks.php

    r1484 r1881  
    9191        public function execute() { 
    9292                $this->run(); 
     93        } 
     94 
     95        public function getCacheMode( $params ) { 
     96                return 'public'; 
    9397        } 
    9498 
     
    484488 
    485489        public function getVersion() { 
    486                 return __CLASS__ . ': $Id: ApiQueryBacklinks.php 62461 2010-02-14 14:29:24Z reedy $'; 
     490                return __CLASS__ . ': $Id: ApiQueryBacklinks.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    487491        } 
    488492} 
  • trunk/w/includes/api/ApiQueryBase.php

    r1484 r1881  
    4545                $this->mDb = null; 
    4646                $this->resetQueryParams(); 
     47        } 
     48 
     49        /** 
     50         * Get the cache mode for the data generated by this module. Override this  
     51         * in the module subclass. 
     52         * 
     53         * Public caching will only be allowed if *all* the modules that supply  
     54         * data for a given request return a cache mode of public. 
     55         */ 
     56        public function getCacheMode( $params ) { 
     57                return 'private'; 
    4758        } 
    4859 
     
    421432         */ 
    422433        public static function getBaseVersion() { 
    423                 return __CLASS__ . ': $Id: ApiQueryBase.php 62461 2010-02-14 14:29:24Z reedy $'; 
     434                return __CLASS__ . ': $Id: ApiQueryBase.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    424435        } 
    425436} 
  • trunk/w/includes/api/ApiQueryBlocks.php

    r1484 r1881  
    279279 
    280280        public function getVersion() { 
    281                 return __CLASS__ . ': $Id: ApiQueryBlocks.php 62513 2010-02-15 12:20:52Z catrope $'; 
     281                return __CLASS__ . ': $Id: ApiQueryBlocks.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    282282        } 
    283283} 
  • trunk/w/includes/api/ApiQueryCategories.php

    r1484 r1881  
    4242        public function execute() { 
    4343                $this->run(); 
     44        } 
     45 
     46        public function getCacheMode( $params ) { 
     47                return 'public'; 
    4448        } 
    4549 
     
    235239 
    236240        public function getVersion() { 
    237                 return __CLASS__ . ': $Id: ApiQueryCategories.php 62466 2010-02-14 15:19:45Z reedy $'; 
     241                return __CLASS__ . ': $Id: ApiQueryCategories.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    238242        } 
    239243} 
  • trunk/w/includes/api/ApiQueryCategoryInfo.php

    r1484 r1881  
    100100        } 
    101101 
     102        public function getCacheMode( $params ) { 
     103                return 'public'; 
     104        } 
     105 
    102106        public function getAllowedParams() { 
    103107                return array ( 
     
    121125 
    122126        public function getVersion() { 
    123                 return __CLASS__ . ': $Id: ApiQueryCategoryInfo.php 61437 2010-01-23 22:26:40Z reedy $'; 
     127                return __CLASS__ . ': $Id: ApiQueryCategoryInfo.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    124128        } 
    125129} 
  • trunk/w/includes/api/ApiQueryCategoryMembers.php

    r1484 r1881  
    4242        public function execute() { 
    4343                $this->run(); 
     44        } 
     45 
     46        public function getCacheMode( $params ) { 
     47                return 'public'; 
    4448        } 
    4549 
     
    295299 
    296300        public function getVersion() { 
    297                 return __CLASS__ . ': $Id: ApiQueryCategoryMembers.php 62410 2010-02-13 01:21:52Z reedy $'; 
     301                return __CLASS__ . ': $Id: ApiQueryCategoryMembers.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    298302        } 
    299303} 
  • trunk/w/includes/api/ApiQueryDeletedrevs.php

    r1484 r1881  
    339339 
    340340        public function getVersion() { 
    341                 return __CLASS__ . ': $Id: ApiQueryDeletedrevs.php 62410 2010-02-13 01:21:52Z reedy $'; 
     341                return __CLASS__ . ': $Id: ApiQueryDeletedrevs.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    342342        } 
    343343} 
  • trunk/w/includes/api/ApiQueryDuplicateFiles.php

    r1484 r1881  
    4242        public function execute() { 
    4343                $this->run(); 
     44        } 
     45 
     46        public function getCacheMode( $params ) { 
     47                return 'public'; 
    4448        } 
    4549 
     
    163167 
    164168        public function getVersion() { 
    165                 return __CLASS__ . ': $Id: ApiQueryDuplicateFiles.php 62414 2010-02-13 01:38:12Z reedy $'; 
     169                return __CLASS__ . ': $Id: ApiQueryDuplicateFiles.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    166170        } 
    167171} 
  • trunk/w/includes/api/ApiQueryExtLinksUsage.php

    r1484 r1881  
    4040        public function execute() { 
    4141                $this->run(); 
     42        } 
     43 
     44        public function getCacheMode( $params ) { 
     45                return 'public'; 
    4246        } 
    4347 
     
    217221 
    218222        public function getVersion() { 
    219                 return __CLASS__ . ': $Id: ApiQueryExtLinksUsage.php 62406 2010-02-13 00:48:31Z reedy $'; 
     223                return __CLASS__ . ': $Id: ApiQueryExtLinksUsage.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    220224        } 
    221225} 
  • trunk/w/includes/api/ApiQueryExternalLinks.php

    r1484 r1881  
    8484        } 
    8585 
     86        public function getCacheMode( $params ) { 
     87                return 'public'; 
     88        } 
     89 
    8690        public function getAllowedParams() { 
    8791                return array( 
     
    116120 
    117121        public function getVersion() { 
    118                 return __CLASS__ . ': $Id: ApiQueryExternalLinks.php 61444 2010-01-23 22:52:40Z reedy $'; 
     122                return __CLASS__ . ': $Id: ApiQueryExternalLinks.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    119123        } 
    120124} 
  • trunk/w/includes/api/ApiQueryImageInfo.php

    r1484 r1881  
    245245        } 
    246246 
     247        public function getCacheMode( $params ) { 
     248                return 'public'; 
     249        } 
     250 
    247251        private function getContinueStr( $img ) 
    248252        { 
     
    335339 
    336340        public function getVersion() { 
    337                 return __CLASS__ . ': $Id: ApiQueryImageInfo.php 62415 2010-02-13 01:41:37Z reedy $'; 
     341                return __CLASS__ . ': $Id: ApiQueryImageInfo.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    338342        } 
    339343} 
  • trunk/w/includes/api/ApiQueryImages.php

    r1484 r1881  
    123123        } 
    124124 
     125        public function getCacheMode( $params ) { 
     126                return 'public'; 
     127        } 
     128 
    125129        public function getAllowedParams() { 
    126130                return array( 
     
    163167 
    164168        public function getVersion() { 
    165                 return __CLASS__ . ': $Id: ApiQueryImages.php 62414 2010-02-13 01:38:12Z reedy $'; 
     169                return __CLASS__ . ': $Id: ApiQueryImages.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    166170        } 
    167171} 
  • trunk/w/includes/api/ApiQueryInfo.php

    r1484 r1881  
    523523 
    524524        /** 
    525          * Get information about watched status and put it in $watched 
     525         * Get information about watched status and put it in $this->watched 
    526526         */ 
    527527        private function getWatchedInfo() 
     
    554554        } 
    555555 
     556        public function getCacheMode( $params ) { 
     557                $publicProps = array( 
     558                        'protection', 
     559                        'talkid', 
     560                        'subjectid', 
     561                        'url', 
     562                        'preload', 
     563                ); 
     564                if ( !is_null( $params['prop'] ) ) { 
     565                        foreach ( $params['prop'] as $prop ) { 
     566                                if ( !in_array( $prop, $publicProps ) ) { 
     567                                        return 'private'; 
     568                                } 
     569                        } 
     570                } 
     571                if ( !is_null( $params['token'] ) ) { 
     572                        return 'private'; 
     573                } 
     574                return 'public'; 
     575        } 
     576 
    556577        public function getAllowedParams() { 
    557578                return array ( 
     
    562583                                        'protection', 
    563584                                        'talkid', 
    564                                         'watched', 
     585                                        'watched', # private 
    565586                                        'subjectid', 
    566587                                        'url', 
    567                                         'readable', 
     588                                        'readable', # private 
    568589                                        'preload' 
     590                                        // If you add more properties here, please consider whether they  
     591                                        // need to be added to getCacheMode() 
    569592                                ) ), 
    570593                        'token' => array ( 
     
    612635 
    613636        public function getVersion() { 
    614                 return __CLASS__ . ': $Id: ApiQueryInfo.php 62415 2010-02-13 01:41:37Z reedy $'; 
     637                return __CLASS__ . ': $Id: ApiQueryInfo.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    615638        } 
    616639} 
  • trunk/w/includes/api/ApiQueryLangLinks.php

    r1484 r1881  
    9494        } 
    9595 
     96        public function getCacheMode( $params ) { 
     97                return 'public'; 
     98        } 
     99 
    96100        public function getAllowedParams() { 
    97101                return array( 
     
    132136 
    133137        public function getVersion() { 
    134                 return __CLASS__ . ': $Id: ApiQueryLangLinks.php 62414 2010-02-13 01:38:12Z reedy $'; 
     138                return __CLASS__ . ': $Id: ApiQueryLangLinks.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    135139        } 
    136140} 
  • trunk/w/includes/api/ApiQueryLinks.php

    r1484 r1881  
    6363        public function execute() { 
    6464                $this->run(); 
     65        } 
     66 
     67        public function getCacheMode( $params ) { 
     68                return 'public'; 
    6569        } 
    6670 
     
    205209 
    206210        public function getVersion() { 
    207                 return __CLASS__ . ': $Id: ApiQueryLinks.php 61444 2010-01-23 22:52:40Z reedy $'; 
     211                return __CLASS__ . ': $Id: ApiQueryLinks.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    208212        } 
    209213} 
  • trunk/w/includes/api/ApiQueryLogEvents.php

    r1484 r1881  
    286286        } 
    287287         
     288        public function getCacheMode( $params ) { 
     289                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { 
     290                        // formatComment() calls wfMsg() among other things 
     291                        return 'anon-public-user-private'; 
     292                } else { 
     293                        return 'public'; 
     294                } 
     295        } 
     296 
    288297        public function getAllowedParams() { 
    289298                global $wgLogTypes; 
     
    365374 
    366375        public function getVersion() { 
    367                 return __CLASS__ . ': $Id: ApiQueryLogEvents.php 62406 2010-02-13 00:48:31Z reedy $'; 
     376                return __CLASS__ . ': $Id: ApiQueryLogEvents.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    368377        } 
    369378} 
  • trunk/w/includes/api/ApiQueryProtectedTitles.php

    r1484 r1881  
    127127        } 
    128128 
     129        public function getCacheMode( $params ) { 
     130                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { 
     131                        // formatComment() calls wfMsg() among other things 
     132                        return 'anon-public-user-private'; 
     133                } else { 
     134                        return 'public'; 
     135                } 
     136        } 
     137 
    129138        public function getAllowedParams() { 
    130139                global $wgRestrictionLevels; 
     
    196205 
    197206        public function getVersion() { 
    198                 return __CLASS__ . ': $Id: ApiQueryProtectedTitles.php 61761 2010-01-31 23:06:35Z reedy $'; 
     207                return __CLASS__ . ': $Id: ApiQueryProtectedTitles.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    199208        } 
    200209} 
  • trunk/w/includes/api/ApiQueryRandom.php

    r1484 r1881  
    122122        } 
    123123 
     124        public function getCacheMode( $params ) { 
     125                return 'public'; 
     126        } 
     127 
    124128        public function getAllowedParams() { 
    125129                return array ( 
  • trunk/w/includes/api/ApiQueryRecentChanges.php

    r1484 r1881  
    423423        } 
    424424 
     425        public function getCacheMode( $params ) { 
     426                if ( isset( $params['show'] ) ) { 
     427                        foreach ( $params['show'] as $show ) { 
     428                                if ( $show === 'patrolled' || $show === '!patrolled' ) { 
     429                                        return 'private'; 
     430                                } 
     431                        } 
     432                } 
     433                if ( isset( $params['token'] ) ) { 
     434                        return 'private'; 
     435                } 
     436                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { 
     437                        // formatComment() calls wfMsg() among other things 
     438                        return 'anon-public-user-private'; 
     439                } 
     440                return 'public'; 
     441        } 
     442 
    425443        public function getAllowedParams() { 
    426444                return array ( 
     
    543561 
    544562        public function getVersion() { 
    545                 return __CLASS__ . ': $Id: ApiQueryRecentChanges.php 62466 2010-02-14 15:19:45Z reedy $'; 
     563                return __CLASS__ . ': $Id: ApiQueryRecentChanges.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    546564        } 
    547565} 
  • trunk/w/includes/api/ApiQueryRevisions.php

    r1484 r1881  
    126126 
    127127                $db = $this->getDB(); 
    128                 $this->addTables( array( 'page', 'revision' ) ); 
     128                $this->addTables( 'page' ); 
    129129                $this->addFields( Revision::selectFields() ); 
    130130                $this->addWhere( 'page_id = rev_page' ); 
     
    189189                                $this->section = false; 
    190190                } 
     191 
     192                //Bug 24166 - API error when using rvprop=tags 
     193                $this->addTables( 'revision' ); 
    191194 
    192195                $userMax = ( $this->fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 ); 
     
    465468        } 
    466469 
     470        public function getCacheMode( $params ) { 
     471                if ( isset( $params['token'] ) ) { 
     472                        return 'private'; 
     473                } 
     474                if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { 
     475                        // formatComment() calls wfMsg() among other things 
     476                        return 'anon-public-user-private'; 
     477                }                
     478                return 'public'; 
     479        } 
     480 
    467481        public function getAllowedParams() { 
    468482                return array ( 
     
    593607 
    594608        public function getVersion() { 
    595                 return __CLASS__ . ': $Id: ApiQueryRevisions.php 62461 2010-02-14 14:29:24Z reedy $'; 
     609                return __CLASS__ . ': $Id: ApiQueryRevisions.php 72117 2010-09-01 16:50:07Z reedy $'; 
    596610        } 
    597611} 
  • trunk/w/includes/api/ApiQuerySearch.php

    r1484 r1881  
    156156        } 
    157157 
     158        public function getCacheMode( $params ) { 
     159                return 'public'; 
     160        } 
     161 
    158162        public function getAllowedParams() { 
    159163                return array ( 
     
    235239 
    236240        public function getVersion() { 
    237                 return __CLASS__ . ': $Id: ApiQuerySearch.php 62412 2010-02-13 01:28:26Z reedy $'; 
     241                return __CLASS__ . ': $Id: ApiQuerySearch.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    238242        } 
    239243} 
  • trunk/w/includes/api/ApiQuerySiteinfo.php

    r1484 r1881  
    422422        } 
    423423 
     424        public function getCacheMode( $params ) { 
     425                return 'public'; 
     426        } 
    424427 
    425428        public function getAllowedParams() { 
     
    498501 
    499502        public function getVersion() { 
    500                 return __CLASS__ . ': $Id: ApiQuerySiteinfo.php 62406 2010-02-13 00:48:31Z reedy $'; 
     503                return __CLASS__ . ': $Id: ApiQuerySiteinfo.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    501504        } 
    502505} 
  • trunk/w/includes/api/ApiQueryTags.php

    r1484 r1881  
    130130        } 
    131131         
     132        public function getCacheMode( $params ) { 
     133                return 'public'; 
     134        } 
     135 
    132136        public function getAllowedParams() { 
    133137                return array ( 
     
    173177 
    174178        public function getVersion() { 
    175                 return __CLASS__ . ': $Id: ApiQueryTags.php 61442 2010-01-23 22:47:49Z reedy $'; 
     179                return __CLASS__ . ': $Id: ApiQueryTags.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    176180        } 
    177181} 
  • trunk/w/includes/api/ApiQueryUserContributions.php

    r1484 r1881  
    339339        } 
    340340 
     341        public function getCacheMode( $params ) { 
     342                // This module provides access to deleted revisions and patrol flags if 
     343                // the requester is logged in 
     344                return 'anon-public-user-private'; 
     345        } 
     346 
    341347        public function getAllowedParams() { 
    342348                return array ( 
     
    436442 
    437443        public function getVersion() { 
    438                 return __CLASS__ . ': $Id: ApiQueryUserContributions.php 62466 2010-02-14 15:19:45Z reedy $'; 
     444                return __CLASS__ . ': $Id: ApiQueryUserContributions.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    439445        } 
    440446} 
  • trunk/w/includes/api/ApiQueryUserInfo.php

    r1484 r1881  
    201201 
    202202        public function getVersion() { 
    203                 return __CLASS__ . ': $Id: ApiQueryUserInfo.php 61437 2010-01-23 22:26:40Z reedy $'; 
     203                return __CLASS__ . ': $Id: ApiQueryUserInfo.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    204204        } 
    205205} 
  • trunk/w/includes/api/ApiQueryUsers.php

    r1484 r1881  
    208208        } 
    209209 
     210        public function getCacheMode( $params ) { 
     211                if ( isset( $params['token'] ) ) { 
     212                        return 'private'; 
     213                } else { 
     214                        return 'public'; 
     215                } 
     216        } 
     217 
    210218        public function getAllowedParams() { 
    211219                return array ( 
     
    257265 
    258266        public function getVersion() { 
    259                 return __CLASS__ . ': $Id: ApiQueryUsers.php 61437 2010-01-23 22:26:40Z reedy $'; 
     267                return __CLASS__ . ': $Id: ApiQueryUsers.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    260268        } 
    261269} 
  • trunk/w/includes/api/ApiQueryWatchlist.php

    r1484 r1881  
    155155                        } 
    156156                         
    157                         // Check permissions.  FIXME: should this check $user instead of $wgUser? 
     157                        // Check permissions. 
    158158                        if ( ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) 
    159159                                $this->dieUsage( "You need the patrol right to request the patrolled flag", 'permissiondenied' ); 
     
    398398 
    399399        public function getVersion() { 
    400                 return __CLASS__ . ': $Id: ApiQueryWatchlist.php 62466 2010-02-14 15:19:45Z reedy $'; 
     400                return __CLASS__ . ': $Id: ApiQueryWatchlist.php 69932 2010-07-26 08:03:21Z tstarling $'; 
    401401        } 
    402402} 
  • trunk/w/includes/api/ApiQueryWatchlistRaw.php

    r1484 r1881  
    187187 
    188188        public function getVersion() { 
    189                 return __CLASS__ . ': $Id: ApiQueryWatchlistRaw.php 62466 2010-02-14 15:19:45Z reedy $'; 
     189                return __CLASS__ . ': $Id: ApiQueryWatchlistRaw.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    190190        } 
    191191} 
  • trunk/w/includes/api/ApiUnblock.php

    r1484 r1881  
    117117        } 
    118118         
     119        public function needsToken() { 
     120                return true; 
     121        } 
     122 
    119123        public function getTokenSalt() { 
    120124                return ''; 
     
    129133 
    130134        public function getVersion() { 
    131                 return __CLASS__ . ': $Id: ApiUnblock.php 62599 2010-02-16 21:59:16Z reedy $'; 
     135                return __CLASS__ . ': $Id: ApiUnblock.php 74217 2010-10-03 15:53:07Z reedy $'; 
    132136        } 
    133137} 
  • trunk/w/includes/api/ApiUndelete.php

    r1484 r1881  
    126126        } 
    127127         
     128        public function needsToken() { 
     129                return true; 
     130        } 
     131 
    128132        public function getTokenSalt() { 
    129133                return ''; 
     
    138142 
    139143        public function getVersion() { 
    140                 return __CLASS__ . ': $Id: ApiUndelete.php 62599 2010-02-16 21:59:16Z reedy $'; 
     144                return __CLASS__ . ': $Id: ApiUndelete.php 74217 2010-10-03 15:53:07Z reedy $'; 
    141145        } 
    142146} 
  • trunk/w/includes/api/ApiUpload.php

    r1484 r1881  
    307307        } 
    308308         
     309        public function needsToken() { 
     310                return true; 
     311        } 
     312 
    309313        public function getTokenSalt() { 
    310314                return ''; 
  • trunk/w/includes/api/ApiUserrights.php

    r1484 r1881  
    102102        ) ); 
    103103        } 
     104 
     105        public function needsToken() { 
     106                return true; 
     107        } 
    104108         
    105109        public function getTokenSalt() { 
     
    124128 
    125129        public function getVersion() { 
    126                 return __CLASS__ . ': $Id: ApiUserrights.php 62686 2010-02-19 01:25:57Z reedy $'; 
     130                return __CLASS__ . ': $Id: ApiUserrights.php 74217 2010-10-03 15:53:07Z reedy $'; 
    127131        } 
    128132} 
  • trunk/w/includes/api/ApiWatch.php

    r1484 r1881  
    109109 
    110110        public function getVersion() { 
    111                 return __CLASS__ . ': $Id: ApiWatch.php 62404 2010-02-13 00:28:27Z reedy $'; 
     111                return __CLASS__ . ': $Id: ApiWatch.php 69578 2010-07-20 02:46:20Z tstarling $'; 
    112112        } 
    113113} 
  • trunk/w/includes/db/DatabaseOracle.php

    r1570 r1881  
    768768        function duplicateTableStructure( $oldName, $newName, $temporary = false, $fname = 'DatabaseOracle::duplicateTableStructure' ) { 
    769769                $temporary = $temporary ? 'TRUE' : 'FALSE'; 
    770                 return $this->query( 'BEGIN DUPLICATE_TABLE(\'' . $oldName . '\', \'' . $newName . '\', ' . $temporary . '); END;', $fname ); 
     770                $oldName = trim(strtoupper($oldName), '"'); 
     771                $oldParts = explode('_', $oldName); 
     772                 
     773                $newName = trim(strtoupper($newName), '"'); 
     774                $newParts = explode('_', $newName); 
     775 
     776                $oldPrefix = ''; 
     777                $newPrefix = ''; 
     778                for ($i = count($oldParts)-1; $i >= 0; $i--) { 
     779                        if ($oldParts[$i] != $newParts[$i]) { 
     780                                $oldPrefix = implode('_', $oldParts).'_'; 
     781                                $newPrefix = implode('_', $newParts).'_'; 
     782                                break; 
     783                        } 
     784                        unset($oldParts[$i]); 
     785                        unset($newParts[$i]); 
     786                } 
     787                 
     788                $tabName = substr($oldName, strlen($oldPrefix)); 
     789                 
     790                return $this->query( 'BEGIN DUPLICATE_TABLE(\'' . $tabName . '\', \'' . $oldPrefix . '\', \''.$newPrefix.'\', ' . $temporary . '); END;', $fname ); 
    771791        } 
    772792 
     
    856876                } 
    857877 
    858                 $fieldInfoStmt = oci_parse( $this->mConn, 'SELECT * FROM '.$this->tableName('wiki_field_info_full').' WHERE table_name '.$tableWhere.' and column_name = \''.$field.'\'' ); 
     878                $fieldInfoStmt = oci_parse( $this->mConn, 'SELECT * FROM wiki_field_info_full WHERE table_name '.$tableWhere.' and column_name = \''.$field.'\'' ); 
    859879                if ( oci_execute( $fieldInfoStmt, OCI_DEFAULT ) === false ) { 
    860880                        $e = oci_error( $fieldInfoStmt ); 
  • trunk/w/includes/diff/DifferenceInterface.php

    r1570 r1881  
    113113                wfProfileIn( __METHOD__ ); 
    114114 
     115                # Allow frames except in certain special cases 
     116                $wgOut->allowClickjacking(); 
    115117 
    116118                # If external diffs are enabled both globally and for the user, 
     
    200202                $editable = $this->mNewRev->getTitle()->userCan( 'edit' ); 
    201203                if ( $editable && $this->mNewRev->isCurrent() && $wgUser->isAllowed( 'rollback' ) ) { 
     204                        $wgOut->preventClickjacking(); 
    202205                        $rollback = '&nbsp;&nbsp;&nbsp;' . $sk->generateRollback( $this->mNewRev ); 
    203206                } else { 
  • trunk/w/includes/json/Services_JSON.php

    r1570 r1881  
    5151* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> 
    5252* @copyright 2005 Michal Migurski 
    53 * @version CVS: $Id: Services_JSON.php 65683 2010-04-30 05:56:15Z tstarling $ 
     53* @version CVS: $Id: Services_JSON.php 79562 2011-01-04 06:15:54Z tstarling $ 
    5454* @license http://www.opensource.org/licenses/bsd-license.php 
    5555* @see http://pear.php.net/pepr/pepr-proposal-show.php?id=198 
  • trunk/w/includes/search/SearchSqlite.php

    r1484 r1881  
    324324 
    325325                $dbw->update( 'searchindex', 
     326                        array( 'si_title' => $title ), 
    326327                        array( 'rowid'  => $id ), 
    327                         array( 'si_title' => $title ), 
    328328                        __METHOD__ ); 
    329329        } 
  • trunk/w/includes/specials/SpecialAllpages.php

    r1484 r1881  
    4141                $this->setHeaders(); 
    4242                $this->outputHeader(); 
     43                $wgOut->allowClickjacking(); 
    4344 
    4445                # GET values 
  • trunk/w/includes/specials/SpecialCategories.php

    r1484 r1881  
    1313                $from = $par; 
    1414        } 
     15        $wgOut->allowClickjacking(); 
    1516        $cap = new CategoryPager( $from ); 
    1617        $cap->doQuery(); 
  • trunk/w/includes/specials/SpecialContributions.php

    r1484 r1881  
    108108                                ); 
    109109                        } 
     110                        $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); 
    110111 
    111112 
     
    429430        var $messages, $target; 
    430431        var $namespace = '', $mDb; 
     432        var $preventClickjacking = false; 
    431433 
    432434        function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) { 
     
    566568                                && $page->quickUserCan( 'edit' ) ) 
    567569                        { 
     570                                $this->preventClickjacking(); 
    568571                                $topmarktext .= ' '.$sk->generateRollback( $rev ); 
    569572                        } 
     
    672675        } 
    673676 
     677        protected function preventClickjacking() { 
     678                $this->preventClickjacking = true; 
     679        } 
     680 
     681        public function getPreventClickjacking() { 
     682                return $this->preventClickjacking; 
     683        } 
    674684} 
  • trunk/w/includes/specials/SpecialLinkSearch.php

    r1484 r1881  
    4545        } 
    4646 
     47        $wgOut->allowClickjacking(); 
     48 
    4749        $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' ); 
    48  
     50         
    4951        $wgOut->addWikiMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' ); 
    5052        $s =    Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . 
  • trunk/w/includes/specials/SpecialSearch.php

    r1484 r1881  
    365365                // add javascript specific to special:search 
    366366                $wgOut->addScriptFile( 'search.js' ); 
     367                $wgOut->allowClickjacking(); 
    367368        } 
    368369 
  • trunk/w/includes/specials/SpecialSpecialpages.php

    r1484 r1881  
    1414 
    1515        $wgOut->setRobotPolicy( 'noindex,nofollow' );  # Is this really needed? 
     16        $wgOut->allowClickjacking(); 
    1617        $sk = $wgUser->getSkin(); 
    1718 
  • trunk/w/includes/specials/SpecialUpload.php

    r1778 r1881  
    2424 
    2525        /** Misc variables **/ 
    26         protected $mRequest;                    // The WebRequest or FauxRequest this form is supposed to handle 
    27         protected $mSourceType; 
    28         protected $mUpload; 
    29         protected $mLocalFile; 
    30         protected $mUploadClicked; 
     26        public $mRequest;                       // The WebRequest or FauxRequest this form is supposed to handle 
     27        public $mSourceType; 
     28        public $mUpload; 
     29        public $mLocalFile; 
     30        public $mUploadClicked; 
    3131 
    3232        /** User input variables from the "description" section **/ 
    33         public    $mDesiredDestName;    // The requested target file name 
    34         /** Xiping.Wang fix #162 **/ 
     33        public $mDesiredDestName;       // The requested target file name 
    3534        public $mComment; 
    36         protected $mLicense; 
    37          
     35        public $mLicense; 
     36 
    3837        /** User input variables from the root section **/ 
    39         protected $mIgnoreWarning; 
    40         protected $mWatchThis; 
    41         protected $mCopyrightStatus; 
    42         protected $mCopyrightSource; 
     38        public $mIgnoreWarning; 
     39        public $mWatchThis; 
     40        public $mCopyrightStatus; 
     41        public $mCopyrightSource; 
    4342 
    4443        /** Hidden variables **/ 
    45         protected $mDestWarningAck; 
    46         protected $mForReUpload;                // The user followed an "overwrite this file" link 
    47         protected $mCancelUpload;               // The user clicked "Cancel and return to upload form" button 
    48         protected $mTokenOk; 
    49         protected $mUploadSuccessful = false;   // Subclasses can use this to determine whether a file was uploaded 
    50          
     44        public $mDestWarningAck; 
     45        public $mForReUpload;           // The user followed an "overwrite this file" link 
     46        public $mCancelUpload;          // The user clicked "Cancel and return to upload form" button 
     47        public $mTokenOk; 
     48        public $mUploadSuccessful = false;      // Subclasses can use this to determine whether a file was uploaded 
     49 
    5150        /** Text injection points for hooks not using HTMLForm **/ 
    5251        public $uploadFormTextTop; 
     
    886885                                        ? 'filereuploadsummary' 
    887886                                        : 'fileuploadsummary', 
    888                                 'cols' => 45, 
     887                                'cols' => $cols, 
    889888                                'rows' => 8, 
    890889                        ) 
     
    10051004                        'wgAjaxUploadDestCheck' => $useAjaxDestCheck, 
    10061005                        'wgAjaxLicensePreview' => $useAjaxLicensePreview, 
    1007                         'wgUploadAutoFill' => !$this->mForReUpload, 
     1006                        'wgUploadAutoFill' => !$this->mForReUpload && 
     1007                                // If we received mDestFile from the request, don't autofill 
     1008                                // the wpDestFile textbox 
     1009                                $this->mDestFile === '', 
    10081010                        'wgUploadSourceIds' => $this->mSourceIds, 
    10091011                ); 
  • trunk/w/includes/specials/SpecialVersion.php

    r1484 r1881  
    3333                $this->setHeaders(); 
    3434                $this->outputHeader(); 
     35                $wgOut->allowClickjacking(); 
    3536 
    3637                $wgOut->addHTML( Xml::openElement( 'div', 
  • trunk/w/profileinfo.php

    r1484 r1881  
    6666 
    6767if ( !$wgEnableProfileInfo ) { 
    68         echo "disabled\n"; 
     68        echo "<p>Disabled</p>\n"; 
     69        echo "</body></html>"; 
    6970        exit( 1 ); 
    7071} 
     
    103104                if ( !$ex ) { 
    104105                        if ( count( $this->children ) ) { 
    105                                 $url = makeurl( false, false, $expand + array( $this->name() => true ) ); 
     106                                $url = getEscapedProfileUrl( false, false, $expand + array( $this->name() => true ) ); 
    106107                                $extet = " <a href=\"$url\">[+]</a>"; 
    107108                        } else $extet = ''; 
     
    112113                                        $e += array( $name => $ep ); 
    113114 
    114                         $extet = " <a href=\"" . makeurl( false, false, $e ) . "\">[&ndash;]</a>"; 
     115                        $extet = " <a href=\"" . getEscapedProfileUrl( false, false, $e ) . "\">[&ndash;]</a>"; 
    115116                } 
    116117                ?> 
     
    231232<table cellspacing="0" border="1"> 
    232233<tr id="top"> 
    233 <th><a href="<?php echo makeurl( false, 'name' ) ?>">Name</a></th> 
    234 <th><a href="<?php echo makeurl( false, 'time' ) ?>">Time (%)</a></th> 
    235 <th><a href="<?php echo makeurl( false, 'memory' ) ?>">Memory (%)</a></th> 
    236 <th><a href="<?php echo makeurl( false, 'count' ) ?>">Count</a></th> 
    237 <th><a href="<?php echo makeurl( false, 'calls_per_req' ) ?>">Calls/req</a></th> 
    238 <th><a href="<?php echo makeurl( false, 'time_per_call' ) ?>">ms/call</a></th> 
    239 <th><a href="<?php echo makeurl( false, 'memory_per_call' ) ?>">kb/call</a></th> 
    240 <th><a href="<?php echo makeurl( false, 'time_per_req' ) ?>">ms/req</a></th> 
    241 <th><a href="<?php echo makeurl( false, 'memory_per_req' ) ?>">kb/req</a></th> 
     234<th><a href="<?php echo getEscapedProfileUrl( false, 'name' ) ?>">Name</a></th> 
     235<th><a href="<?php echo getEscapedProfileUrl( false, 'time' ) ?>">Time (%)</a></th> 
     236<th><a href="<?php echo getEscapedProfileUrl( false, 'memory' ) ?>">Memory (%)</a></th> 
     237<th><a href="<?php echo getEscapedProfileUrl( false, 'count' ) ?>">Count</a></th> 
     238<th><a href="<?php echo getEscapedProfileUrl( false, 'calls_per_req' ) ?>">Calls/req</a></th> 
     239<th><a href="<?php echo getEscapedProfileUrl( false, 'time_per_call' ) ?>">ms/call</a></th> 
     240<th><a href="<?php echo getEscapedProfileUrl( false, 'memory_per_call' ) ?>">kb/call</a></th> 
     241<th><a href="<?php echo getEscapedProfileUrl( false, 'time_per_req' ) ?>">ms/req</a></th> 
     242<th><a href="<?php echo getEscapedProfileUrl( false, 'memory_per_req' ) ?>">kb/req</a></th> 
    242243</tr> 
    243244<?php 
     
    246247$totalmemory = 0.0; 
    247248 
    248 function makeurl( $_filter = false, $_sort = false, $_expand = false ) { 
     249function getEscapedProfileUrl( $_filter = false, $_sort = false, $_expand = false ) { 
    249250        global $filter, $sort, $expand; 
    250251 
     
    252253                $_expand = $expand; 
    253254 
    254         $nfilter = $_filter ? $_filter : $filter; 
    255         $nsort = $_sort ? $_sort : $sort; 
    256         $exp = urlencode( implode( ',', array_keys( $_expand ) ) ); 
    257         return "?filter=$nfilter&amp;sort=$nsort&amp;expand=$exp"; 
     255        return htmlspecialchars( 
     256                '?' .  
     257                wfArrayToCGI( array( 
     258                        'filter' => $_filter ? $_filter : $filter, 
     259                        'sort' => $_sort ? $_sort : $sort, 
     260                        'expand' => implode( ',', array_keys( $_expand ) )  
     261                ) ) 
     262        ); 
    258263} 
    259264 
  • trunk/w/skins/Vector.php

    r1484 r1881  
    449449                $this->html( 'headelement' ); 
    450450?> 
    451                 <div id="page-base" class="noprint"></div> 
    452                 <div id="head-base" class="noprint"></div> 
     451                <div id="mw-page-base" class="noprint"></div> 
     452                <div id="mw-head-base" class="noprint"></div> 
    453453                <!-- content --> 
    454454                <div id="content" <?php $this->html('specialpageattributes') ?>> 
     
    484484                                <!-- jumpto --> 
    485485                                <div id="jump-to-nav"> 
    486                                         <?php $this->msg( 'jumpto' ) ?><a href="#head"><?php $this->msg( 'jumptonavigation' ) ?></a>, 
     486                                        <?php $this->msg( 'jumpto' ) ?> <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a>, 
    487487                                        <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a> 
    488488                                </div> 
     
    508508                <!-- /content --> 
    509509                <!-- header --> 
    510                 <div id="head" class="noprint"> 
     510                <div id="mw-head" class="noprint"> 
    511511                        <?php $this->renderNavigation( 'PERSONAL' ); ?> 
    512512                        <div id="left-navigation"> 
     
    519519                <!-- /header --> 
    520520                <!-- panel --> 
    521                         <div id="panel" class="noprint"> 
     521                        <div id="mw-panel" class="noprint"> 
    522522                                <!-- logo --> 
    523523                                        <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey( 'p-logo' ) ?>></a></div> 
  • trunk/w/skins/common/wikibits.js

    r1570 r1881  
    3030// string (bug 23171) 
    3131var ie6_bugs = false; 
    32 if ( /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null 
     32if ( /msie ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null 
    3333&& parseFloat( RegExp.$1 ) <= 6.0 ) { 
    3434        ie6_bugs = true; 
     
    245245                var linkContainers = [ 
    246246                        'column-one', // Monobook and Modern 
    247                         'head', 'panel', 'p-logo' // Vector 
     247                        'mw-head', 'mw-panel', 'p-logo' // Vector 
    248248                ]; 
    249249                for ( var i in linkContainers ) { 
     
    375375 
    376376/* Dummy for deprecated function */ 
     377window.ta = []; 
    377378function akeytt( doId ) { 
    378379} 
  • trunk/w/skins/vector/experiments/babaco-colors-a.css

    r1484 r1881  
    1414 
    1515/* Framework */ 
    16 #page-base { 
     16#mw-page-base { 
    1717        background-color: inherit !important; 
    1818        background-image: none !important; 
     
    6666        font-weight:normal; 
    6767} 
    68 body #panel div.portal div.body { 
     68body #mw-panel div.portal div.body { 
    6969        background-image:url(images/new-portal-break-ltr.png); 
    7070} 
    71 body.rtl #panel div.portal div.body { 
     71body.rtl #mw-panel div.portal div.body { 
    7272        background-image:url(images/new-portal-break-rtl.png); 
    7373} 
     
    102102        background-color: #f7f7f7; 
    103103} 
    104 #panel div.portal h5 { 
     104#mw-panel div.portal h5 { 
    105105        font-weight:bold; 
    106106        margin-bottom:0; 
  • trunk/w/skins/vector/experiments/babaco-colors-b.css

    r1484 r1881  
    99 
    1010/* Framework */ 
    11 #page-base { 
     11#mw-page-base { 
    1212        background-color: inherit !important; 
    1313        background-image: none !important; 
  • trunk/w/skins/vector/experiments/babaco-colors-c.css

    r1484 r1881  
    22 
    33/* ridding ourselves of the gradient */ 
    4 #page-base { 
     4#mw-page-base { 
    55        background-color: inherit !important; 
    66        background-image: none !important; 
     
    5454        font-weight:normal; 
    5555} 
    56 body #panel div.portal div.body { 
     56body #mw-panel div.portal div.body { 
    5757        background-image:url(images/new-portal-break-ltr.png); 
    5858} 
     
    7878        background-color: #f7f7f7; 
    7979} 
    80 #panel div.portal h5 { 
     80#mw-panel div.portal h5 { 
    8181        font-weight:bold; 
    8282        margin-bottom:0; 
  • trunk/w/skins/vector/experiments/new-tabs.css

    r1484 r1881  
    192192        } 
    193193        /* @noflip */ 
    194         body #head div.vectorMenu h5 { 
     194        body #mw-head div.vectorMenu h5 { 
    195195                background-image: url(../images/arrow-down-icon.png); 
    196196                background-position: center center; 
  • trunk/w/skins/vector/main-ltr.css

    r1570 r1881  
    3838} 
    3939/* Head */ 
    40 #page-base { 
     40#mw-page-base { 
    4141        height: 5em; 
    4242        background-color: white; 
     
    4545        background-repeat: repeat-x; 
    4646} 
    47 #head-base { 
     47#mw-head-base { 
    4848        margin-top: -5em; 
    4949        margin-left: 10em; 
     
    5353        background-repeat: repeat-x; 
    5454} 
    55 #head { 
     55#mw-head { 
    5656        position: absolute; 
    5757        top: 0; 
     
    5959        width: 100%; 
    6060} 
    61 #head h5 { 
     61#mw-head h5 { 
    6262        margin: 0; 
    6363        padding: 0; 
     
    213213        /* OVERRIDDEN BY COMPLIANT BROWSERS */ 
    214214        /* @noflip */ 
    215         #head div.vectorMenu h5 { 
     215        #mw-head div.vectorMenu h5 { 
    216216                float: left; 
    217217                background-image: url(images/tab-break.png); 
     
    219219        } 
    220220        /* IGNORED BY IE6 */ 
    221         #head div.vectorMenu > h5 { 
     221        #mw-head div.vectorMenu > h5 { 
    222222                background-image: none; 
    223223        } 
    224         #head div.vectorMenu h5 { 
     224        #mw-head div.vectorMenu h5 { 
    225225                background-position: bottom left; 
    226226                margin-left: -1px; 
     
    386386        } 
    387387/* Panel */ 
    388 #panel { 
     388#mw-panel { 
    389389        position: absolute; 
    390390        top: 160px; 
     
    393393        left: 0; 
    394394} 
    395         #panel div.portal { 
     395        #mw-panel div.portal { 
    396396                padding-bottom: 1.5em; 
    397397        } 
    398         #panel div.portal h5 { 
     398        #mw-panel div.portal h5 { 
    399399                font-weight: normal; 
    400400                color: #444444; 
     
    406406                font-size: 0.75em; 
    407407        } 
    408         #panel div.portal div.body { 
     408        #mw-panel div.portal div.body { 
    409409                margin: 0; 
    410410                padding-top: 0.5em; 
     
    414414                background-position: top left; 
    415415        } 
    416         #panel div.portal div.body ul { 
     416        #mw-panel div.portal div.body ul { 
    417417                list-style: none; 
    418418                list-style-image: none; 
     
    421421                margin: 0; 
    422422        } 
    423         #panel div.portal div.body ul li { 
     423        #mw-panel div.portal div.body ul li { 
    424424                line-height: 1.125em; 
    425425                padding: 0; 
     
    429429                font-size: 0.75em; 
    430430        } 
    431         #panel div.portal div.body ul li a { 
     431        #mw-panel div.portal div.body ul li a { 
    432432                color: #0645ad; 
    433433        } 
    434         #panel div.portal div.body ul li a:visited { 
     434        #mw-panel div.portal div.body ul li a:visited { 
    435435                color: #0b0080; 
    436436        } 
  • trunk/w/skins/vector/main-rtl.css

    r1570 r1881  
    3838} 
    3939/* Head */ 
    40 #page-base { 
     40#mw-page-base { 
    4141        height: 5em; 
    4242        background-color: white; 
     
    4545        background-repeat: repeat-x; 
    4646} 
    47 #head-base { 
     47#mw-head-base { 
    4848        margin-top: -5em; 
    4949        margin-right: 10em; 
     
    5353        background-repeat: repeat-x; 
    5454} 
    55 #head { 
     55#mw-head { 
    5656        position: absolute; 
    5757        top: 0; 
     
    5959        width: 100%; 
    6060} 
    61 #head h5 { 
     61#mw-head h5 { 
    6262        margin: 0; 
    6363        padding: 0; 
     
    213213        /* OVERRIDDEN BY COMPLIANT BROWSERS */ 
    214214        /* @noflip */ 
    215         #head div.vectorMenu h5 { 
     215        #mw-head div.vectorMenu h5 { 
    216216                float: left; 
    217217                background-image: url(images/tab-break.png); 
     
    219219        } 
    220220        /* IGNORED BY IE6 */ 
    221         #head div.vectorMenu > h5 { 
     221        #mw-head div.vectorMenu > h5 { 
    222222                background-image: none; 
    223223        } 
    224         #head div.vectorMenu h5 { 
     224        #mw-head div.vectorMenu h5 { 
    225225                background-position: bottom right; 
    226226                margin-right: -1px; 
     
    386386        } 
    387387/* Panel */ 
    388 #panel { 
     388#mw-panel { 
    389389        position: absolute; 
    390390        top: 160px; 
     
    393393        right: 0; 
    394394} 
    395         #panel div.portal { 
     395        #mw-panel div.portal { 
    396396                padding-bottom: 1.5em; 
    397397        } 
    398         #panel div.portal h5 { 
     398        #mw-panel div.portal h5 { 
    399399                font-weight: normal; 
    400400                color: #444444; 
     
    406406                font-size: 0.75em; 
    407407        } 
    408         #panel div.portal div.body { 
     408        #mw-panel div.portal div.body { 
    409409                margin: 0; 
    410410                padding-top: 0.5em; 
     
    414414                background-position: top right; 
    415415        } 
    416         #panel div.portal div.body ul { 
     416        #mw-panel div.portal div.body ul { 
    417417                list-style: none; 
    418418                list-style-image: none; 
     
    421421                margin: 0; 
    422422        } 
    423         #panel div.portal div.body ul li { 
     423        #mw-panel div.portal div.body ul li { 
    424424                line-height: 1.125em; 
    425425                padding: 0; 
     
    429429                font-size: 0.75em; 
    430430        } 
    431         #panel div.portal div.body ul li a { 
     431        #mw-panel div.portal div.body ul li a { 
    432432                color: #0645ad; 
    433433        } 
    434         #panel div.portal div.body ul li a:visited { 
     434        #mw-panel div.portal div.body ul li a:visited { 
    435435                color: #0b0080; 
    436436        } 
Note: See TracChangeset for help on using the changeset viewer.