Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * @ingroup FileRepo |
8 | 8 | */ |
9 | 9 | class FSRepo extends FileRepo { |
10 | | - var $directory, $deletedDir, $url, $deletedHashLevels; |
| 10 | + var $directory, $deletedDir, $url, $deletedHashLevels, $fileMode; |
11 | 11 | var $fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' ); |
12 | 12 | var $oldFileFactory = false; |
13 | 13 | var $pathDisclosureProtection = 'simple'; |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | $this->deletedHashLevels = isset( $info['deletedHashLevels'] ) ? |
25 | 25 | $info['deletedHashLevels'] : $this->hashLevels; |
26 | 26 | $this->deletedDir = isset( $info['deletedDir'] ) ? $info['deletedDir'] : false; |
| 27 | + $this->fileMode = isset( $info['fileMode'] ) ? $info['fileMode'] : 0644; |
27 | 28 | } |
28 | 29 | |
29 | 30 | /** |
— | — | @@ -203,7 +204,7 @@ |
204 | 205 | } |
205 | 206 | } |
206 | 207 | if ( $good ) { |
207 | | - chmod( $dstPath, 0644 ); |
| 208 | + @chmod( $dstPath, $this->fileMode ); |
208 | 209 | $status->successCount++; |
209 | 210 | } else { |
210 | 211 | $status->failCount++; |
— | — | @@ -389,7 +390,7 @@ |
390 | 391 | $status->successCount++; |
391 | 392 | wfDebug(__METHOD__.": wrote tempfile $srcPath to $dstPath\n"); |
392 | 393 | // Thread-safe override for umask |
393 | | - chmod( $dstPath, 0644 ); |
| 394 | + @chmod( $dstPath, $this->fileMode ); |
394 | 395 | } else { |
395 | 396 | $status->failCount++; |
396 | 397 | } |
— | — | @@ -466,7 +467,7 @@ |
467 | 468 | $status->error( 'filerenameerror', $srcPath, $archivePath ); |
468 | 469 | $good = false; |
469 | 470 | } else { |
470 | | - @chmod( $archivePath, 0644 ); |
| 471 | + @chmod( $archivePath, $this->fileMode ); |
471 | 472 | } |
472 | 473 | } |
473 | 474 | if ( $good ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -208,6 +208,8 @@ |
209 | 209 | * May be 'paranoid' to remove all parameters from error messages, 'none' to |
210 | 210 | * leave the paths in unchanged, or 'simple' to replace paths with |
211 | 211 | * placeholders. Default for LocalRepo is 'simple'. |
| 212 | + * fileMode This allows wikis to set the file mode when uploading/moving files. Default |
| 213 | + * is 0644. |
212 | 214 | * |
213 | 215 | * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored |
214 | 216 | * for local repositories: |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -22,6 +22,8 @@ |
23 | 23 | |
24 | 24 | * (bug 18222) $wgMinimalPasswordLength default is now 1 |
25 | 25 | * $wgSessionHandler can be used to configure session.save_handler |
| 26 | +* $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to |
| 27 | + be used when uploading/moving files |
26 | 28 | |
27 | 29 | === New features in 1.16 === |
28 | 30 | |
— | — | @@ -113,8 +115,8 @@ |
114 | 116 | * (bug 6802) profileinfo.php now also work on other database servers than MySQL |
115 | 117 | * (bug 16925) Diffs no longer fail when $wgExternalDiffEngine is set to 'wikidiff' |
116 | 118 | or 'wikidiff2' but extension is not installed |
| 119 | +* (bug 18326) Chmod errors in file repos have been hidden |
117 | 120 | |
118 | | - |
119 | 121 | == API changes in 1.16 == |
120 | 122 | |
121 | 123 | * Added uiprop=changeablegroups to meta=userinfo |