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
Merge "Parser: Add guessSectionNameFromStrippedText() and refactor"
[lhc/web/wiklou.git]
/
includes
/
filerepo
/
file
/
UnregisteredLocalFile.php
diff --git
a/includes/filerepo/file/UnregisteredLocalFile.php
b/includes/filerepo/file/UnregisteredLocalFile.php
index
5ee25cd
..
fde68bb
100644
(file)
--- a/
includes/filerepo/file/UnregisteredLocalFile.php
+++ b/
includes/filerepo/file/UnregisteredLocalFile.php
@@
-111,6
+111,11
@@
class UnregisteredLocalFile extends File {
* @return bool
*/
private function cachePageDimensions( $page = 1 ) {
* @return bool
*/
private function cachePageDimensions( $page = 1 ) {
+ $page = (int)$page;
+ if ( $page < 1 ) {
+ $page = 1;
+ }
+
if ( !isset( $this->dims[$page] ) ) {
if ( !$this->getHandler() ) {
return false;
if ( !isset( $this->dims[$page] ) ) {
if ( !$this->getHandler() ) {
return false;
@@
-146,7
+151,7
@@
class UnregisteredLocalFile extends File {
*/
function getMimeType() {
if ( !isset( $this->mime ) ) {
*/
function getMimeType() {
if ( !isset( $this->mime ) ) {
- $magic = M
imeMagic::singleton
();
+ $magic = M
ediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer
();
$this->mime = $magic->guessMimeType( $this->getLocalRefPath() );
}
$this->mime = $magic->guessMimeType( $this->getLocalRefPath() );
}
@@
-166,8
+171,8
@@
class UnregisteredLocalFile extends File {
}
/**
}
/**
- * @return int
- */
+
* @return int
+
*/
function getBitDepth() {
$gis = $this->getImageSize( $this->getLocalRefPath() );
function getBitDepth() {
$gis = $this->getImageSize( $this->getLocalRefPath() );