Merge "Only bin/ulimit4.sh is used by MW in GlobalFunctions.php"
authorDemon <chadh@wikimedia.org>
Thu, 27 Sep 2012 00:31:04 +0000 (00:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 27 Sep 2012 00:31:04 +0000 (00:31 +0000)
.gitignore
includes/Setup.php
includes/libs/GenericArrayObject.php
maintenance/cleanupUploadStash.php
tests/parser/parserTests.txt

index d3c56bc..0be75c5 100644 (file)
@@ -33,7 +33,7 @@ StartProfiler.php
 ## Mac OS X
 .DS_Store
 ## Windows
-thumbs.db
+Thumbs.db
 
 # Misc
 .buildpath
index 924c3c0..5c5d7d1 100644 (file)
@@ -369,7 +369,7 @@ if ( $wgNewUserLog ) {
 }
 
 if ( $wgCookieSecure === 'detect' ) {
-       $wgCookieSecure = ( WebRequest::detectProtocol() === 'https:' );
+       $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
 }
 
 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
index b4b9d61..e72541c 100644 (file)
@@ -28,7 +28,6 @@
  * @since 1.20
  *
  * @file
- * @ingroup Diff
  *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -61,13 +60,11 @@ abstract class GenericArrayObject extends ArrayObject {
         * @return integer
         */
        protected function getNewOffset() {
-               while ( true ) {
-                       if ( !$this->offsetExists( $this->indexOffset ) ) {
-                               return $this->indexOffset;
-                       }
-
+               while ( $this->offsetExists( $this->indexOffset ) ) {
                        $this->indexOffset++;
                }
+
+               return $this->indexOffset;
        }
 
        /**
index cc32946..99985b5 100644 (file)
@@ -41,18 +41,20 @@ class UploadStashCleanup extends Maintenance {
        }
 
        public function execute() {
+               global $wgUploadStashMaxAge;
+
                $repo = RepoGroup::singleton()->getLocalRepo();
 
                $dbr = $repo->getSlaveDb();
 
                // how far back should this look for files to delete?
-               global $wgUploadStashMaxAge;
+               $cutoff = time() - $wgUploadStashMaxAge;
 
                $this->output( "Getting list of files to clean up...\n" );
                $res = $dbr->select(
                        'uploadstash',
                        'us_key',
-                       'us_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( time() - $wgUploadStashMaxAge ) ),
+                       'us_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $cutoff ) ),
                        __METHOD__
                );
 
@@ -88,6 +90,22 @@ class UploadStashCleanup extends Maintenance {
                        }
                }
                $this->output( "$i done\n" );
+
+               $tempRepo = $repo->getTempRepo();
+               $dir      = $tempRepo->getZonePath( 'thumb' );
+               $iterator = $tempRepo->getBackend()->getFileList( array( 'dir' => $dir ) );
+
+               $this->output( "Deleting old thumbnails...\n" );
+               $i = 0;
+               foreach ( $iterator as $file ) {
+                       if ( wfTimestamp( TS_UNIX, $tempRepo->getFileTimestamp( "$dir/$file" ) ) < $cutoff ) {
+                               $tempRepo->quickPurge( "$dir/$file" );
+                       }
+                       if ( $i % 100 == 0 ) {
+                               $this->output( "$i\n" );
+                       }
+               }
+               $this->output( "$i done\n" );
        }
 }
 
index dacc726..0ba21d9 100644 (file)
@@ -2852,6 +2852,47 @@ Failing to transform badly formed HTML into correct XHTML
 </p>
 !!end
 
+!! test
+Handling html with a div self-closing tag
+!! input
+<div title />
+<div title/>
+<div title/ >
+<div title=bar />
+<div title=bar/>
+<div title=bar/ >
+!! result
+<p>&lt;div title /&gt;
+&lt;div title/&gt;
+</p>
+<div>
+<p>&lt;div title=bar /&gt;
+&lt;div title=bar/&gt;
+</p>
+<div title="bar/"></div>
+</div>
+
+!! end
+
+!! test
+Handling html with a br self-closing tag
+!! input
+<br title />
+<br title/>
+<br title/ >
+<br title=bar />
+<br title=bar/>
+<br title=bar/ >
+!! result
+<p><br title="title" />
+<br title="title" />
+<br />
+<br title="bar" />
+<br title="bar" />
+<br title="bar/" />
+</p>
+!! end
+
 !! test
 Horizontal ruler (should it add that extra space?)
 !! input