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
Fix class name of BcryptPasswordTest
[lhc/web/wiklou.git]
/
img_auth.php
diff --git
a/img_auth.php
b/img_auth.php
index
22fd401
..
d636188
100644
(file)
--- a/
img_auth.php
+++ b/
img_auth.php
@@
-43,20
+43,18
@@
require __DIR__ . '/includes/WebStart.php';
# Set action base paths so that WebRequest::getPathInfo()
# recognizes the "X" as the 'title' in ../img_auth.php/X urls.
$wgArticlePath = false; # Don't let a "/*" article path clober our action path
# Set action base paths so that WebRequest::getPathInfo()
# recognizes the "X" as the 'title' in ../img_auth.php/X urls.
$wgArticlePath = false; # Don't let a "/*" article path clober our action path
-$wgActionPaths =
array( "$wgUploadPath/" )
;
+$wgActionPaths =
[ "$wgUploadPath/" ]
;
wfImageAuthMain();
wfImageAuthMain();
-wfLogProfilingData();
-// Commit and close up!
-$factory = wfGetLBFactory();
-$factory->commitMasterChanges();
-$factory->shutdown();
+
+$mediawiki = new MediaWiki();
+$mediawiki->doPostOutputShutdown( 'fast' );
function wfImageAuthMain() {
global $wgImgAuthUrlPathMap;
$request = RequestContext::getMain()->getRequest();
function wfImageAuthMain() {
global $wgImgAuthUrlPathMap;
$request = RequestContext::getMain()->getRequest();
- $publicWiki = in_array( 'read', User::getGroupPermissions(
array( '*' )
), true );
+ $publicWiki = in_array( 'read', User::getGroupPermissions(
[ '*' ]
), true );
// Get the requested file path (source file or thumbnail)
$matches = WebRequest::getPathInfo();
// Get the requested file path (source file or thumbnail)
$matches = WebRequest::getPathInfo();
@@
-71,7
+69,7
@@
function wfImageAuthMain() {
}
// Check for bug 28235: QUERY_STRING overriding the correct extension
}
// Check for bug 28235: QUERY_STRING overriding the correct extension
- $whitelist =
array()
;
+ $whitelist =
[]
;
$extension = FileBackend::extensionFromPath( $path, 'rawcase' );
if ( $extension != '' ) {
$whitelist[] = $extension;
$extension = FileBackend::extensionFromPath( $path, 'rawcase' );
if ( $extension != '' ) {
$whitelist[] = $extension;
@@
-92,10
+90,10
@@
function wfImageAuthMain() {
wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $path );
return;
}
wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $path );
return;
}
- if ( $be->fileExists(
array( 'src' => $filename )
) ) {
+ if ( $be->fileExists(
[ 'src' => $filename ]
) ) {
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
- $be->streamFile(
array( 'src' => $filename )
,
-
array( 'Cache-Control: private', 'Vary: Cookie' )
);
+ $be->streamFile(
[ 'src' => $filename ]
,
+
[ 'Cache-Control: private', 'Vary: Cookie' ]
);
} else {
wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $path );
}
} else {
wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $path );
}
@@
-135,7
+133,7
@@
function wfImageAuthMain() {
}
}
}
}
- $headers =
array()
; // extra HTTP headers to send
+ $headers =
[]
; // extra HTTP headers to send
if ( !$publicWiki ) {
// For private wikis, run extra auth checks and set cache control headers
if ( !$publicWiki ) {
// For private wikis, run extra auth checks and set cache control headers
@@
-151,7
+149,7
@@
function wfImageAuthMain() {
// Run hook for extension authorization plugins
/** @var $result array */
$result = null;
// Run hook for extension authorization plugins
/** @var $result array */
$result = null;
- if ( !Hooks::run( 'ImgAuthBeforeStream',
array( &$title, &$path, &$name, &$result )
) ) {
+ if ( !Hooks::run( 'ImgAuthBeforeStream',
[ &$title, &$path, &$name, &$result ]
) ) {
wfForbidden( $result[0], $result[1], array_slice( $result, 2 ) );
return;
}
wfForbidden( $result[0], $result[1], array_slice( $result, 2 ) );
return;
}
@@
-197,7
+195,7
@@
function wfForbidden( $msg1, $msg2 ) {
wfMessage( $msg2, $args )->inLanguage( 'en' )->text()
);
wfMessage( $msg2, $args )->inLanguage( 'en' )->text()
);
-
header( 'HTTP/1.0 403 Forbidden'
);
+
HttpStatus::header( 403
);
header( 'Cache-Control: no-cache' );
header( 'Content-Type: text/html; charset=utf-8' );
echo <<<ENDS
header( 'Cache-Control: no-cache' );
header( 'Content-Type: text/html; charset=utf-8' );
echo <<<ENDS