dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated dev dependancy phpunit/phpunit from v4.8.35 to v4.8.36
[lhc/web/wiklou.git]
/
includes
/
filerepo
/
FileRepo.php
diff --git
a/includes/filerepo/FileRepo.php
b/includes/filerepo/FileRepo.php
index
66dab99
..
5005280
100644
(file)
--- a/
includes/filerepo/FileRepo.php
+++ b/
includes/filerepo/FileRepo.php
@@
-99,7
+99,7
@@
class FileRepo {
*/
protected $pathDisclosureProtection = 'simple';
*/
protected $pathDisclosureProtection = 'simple';
- /** @var
bool
Public zone URL. */
+ /** @var
string|false
Public zone URL. */
protected $url;
/** @var string The base thumbnail URL. Defaults to "<url>/thumb". */
protected $url;
/** @var string The base thumbnail URL. Defaults to "<url>/thumb". */
@@
-309,7
+309,7
@@
class FileRepo {
* @return bool Whether non-ASCII path characters are allowed
*/
public function backendSupportsUnicodePaths() {
* @return bool Whether non-ASCII path characters are allowed
*/
public function backendSupportsUnicodePaths() {
- return ( $this->getBackend()->getFeatures() & FileBackend::ATTR_UNICODE_PATHS );
+ return (
bool)(
$this->getBackend()->getFeatures() & FileBackend::ATTR_UNICODE_PATHS );
}
/**
}
/**
@@
-737,7
+737,7
@@
class FileRepo {
* constructor, whereas local repositories use the local Title functions.
*
* @param string $name
* constructor, whereas local repositories use the local Title functions.
*
* @param string $name
- * @return string
+ * @return string
|false
*/
public function getDescriptionUrl( $name ) {
$encName = wfUrlencode( $name );
*/
public function getDescriptionUrl( $name ) {
$encName = wfUrlencode( $name );
@@
-771,12
+771,12
@@
class FileRepo {
*
* @param string $name Name of image to fetch
* @param string $lang Language to fetch it in, if any.
*
* @param string $name Name of image to fetch
* @param string $lang Language to fetch it in, if any.
- * @return string
+ * @return string
|false
*/
public function getDescriptionRenderUrl( $name, $lang = null ) {
$query = 'action=render';
if ( !is_null( $lang ) ) {
*/
public function getDescriptionRenderUrl( $name, $lang = null ) {
$query = 'action=render';
if ( !is_null( $lang ) ) {
- $query .= '&uselang=' .
$lang
;
+ $query .= '&uselang=' .
urlencode( $lang )
;
}
if ( isset( $this->scriptDirUrl ) ) {
return $this->makeUrl(
}
if ( isset( $this->scriptDirUrl ) ) {
return $this->makeUrl(
@@
-1059,7
+1059,7
@@
class FileRepo {
/**
* Pick a random name in the temp zone and store a file to it.
/**
* Pick a random name in the temp zone and store a file to it.
- * Returns a
FileRepo
Status object with the file Virtual URL in the value,
+ * Returns a Status object with the file Virtual URL in the value,
* file can later be disposed using FileRepo::freeTemp().
*
* @param string $originalName The base name of the file as specified
* file can later be disposed using FileRepo::freeTemp().
*
* @param string $originalName The base name of the file as specified
@@
-1143,7
+1143,7
@@
class FileRepo {
* Copy or move a file either from a storage path, virtual URL,
* or file system path, into this repository at the specified destination location.
*
* Copy or move a file either from a storage path, virtual URL,
* or file system path, into this repository at the specified destination location.
*
- * Returns a
FileRepo
Status object. On success, the value contains "new" or
+ * Returns a Status object. On success, the value contains "new" or
* "archived", to indicate whether the file was new with that name.
*
* Options to $options include:
* "archived", to indicate whether the file was new with that name.
*
* Options to $options include:
@@
-1448,7
+1448,7
@@
class FileRepo {
'dst' => $archivePath,
// We may have 2+ identical files being deleted,
// all of which will map to the same destination file
'dst' => $archivePath,
// We may have 2+ identical files being deleted,
// all of which will map to the same destination file
- 'overwriteSame' => true // also see
bug 31
792
+ 'overwriteSame' => true // also see
T33
792
];
}
];
}
@@
-1602,9
+1602,15
@@
class FileRepo {
$path = $this->resolveToStoragePath( $virtualUrl );
$params = [ 'src' => $path, 'headers' => $headers, 'options' => $optHeaders ];
$path = $this->resolveToStoragePath( $virtualUrl );
$params = [ 'src' => $path, 'headers' => $headers, 'options' => $optHeaders ];
+ // T172851: HHVM does not flush the output properly, causing OOM
+ ob_start( null, 1048576 );
+ ob_implicit_flush( true );
+
$status = $this->newGood();
$status->merge( $this->backend->streamFile( $params ) );
$status = $this->newGood();
$status->merge( $this->backend->streamFile( $params ) );
+ ob_end_flush();
+
return $status;
}
return $status;
}
@@
-1924,12
+1930,3
@@
class FileRepo {
return $this->supportsSha1URLs;
}
}
return $this->supportsSha1URLs;
}
}
-
-/**
- * FileRepo for temporary files created via FileRepo::getTempRepo()
- */
-class TempFileRepo extends FileRepo {
- public function getTempRepo() {
- throw new MWException( "Cannot get a temp repo from a temp repo." );
- }
-}