KOKOS250 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/286375
Change subject: Improve the check of writability into temporary directory.
......................................................................
Improve the check of writability into temporary directory.
Bug: T126736
Change-Id: Iddfa609a511e0ad191dbbfca18ecc6da5ce5b03f
---
M includes/GlobalFunctions.php
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/75/286375/1
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 5c42bc2..7984754 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2117,9 +2117,15 @@
foreach ( $tmpDir as $tmp ) {
if ( $tmp && file_exists( $tmp ) && is_dir( $tmp ) &&
is_writable( $tmp ) ) {
- return $tmp;
+ $filename = $tmp . DIRECTORY_SEPARATOR .
'mw_tmpdir_check_' . time();
+ touch( $filename );
+ if ( file_exists( $filename ) ) {
+ unlink( $filename );
+ return $tmp;
+ }
}
}
+
throw new MWException( 'No writable temporary directory could be found.
' .
'Please set $wgTmpDirectory to a writable directory.' );
}
--
To view, visit https://gerrit.wikimedia.org/r/286375
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddfa609a511e0ad191dbbfca18ecc6da5ce5b03f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: KOKOS250 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits