Thumbnails didn't work since Update to 1.19
Hi Sumana,
I found a problem in the patch for open_base_dir. I changed the upload_tmp_dir to /srv/php-tmp/ in my php.ini. This is a security thing. So the patcht checks first for /tmp which is the system tmp directory and this drops out an open_basedir error in apache log. Then it goes to the php.ini upload_tmp_dir, which works. I think the order of the patch schould changed to first look at php and then the system temp dir to avoid the error in apache log.
Greetings Andreas
Andreas, can you go ahead and just submit a corrected patch either via Developer access or via the bug in Bugzilla?
Hi, I don't have access to Bugzilla, so here is my Patch, the whole function wfTempDir() looks like that on my Mediawiki:
function wfTempDir() {
foreach( array( 'TMPDIR', 'TMP', 'TEMP' ) as $var ) {
$tmp = getenv( $var );
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
if (ini_get('upload_tmp_dir')!==false) {
$tmp = ini_get('upload_tmp_dir');
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
if( function_exists( 'sys_get_temp_dir' ) ) {
$tmp = sys_get_temp_dir();
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
# Usual defaults
return wfIsWindows() ? 'C:\Windows\Temp' : '/tmp';
}
You do have access to Bugzilla: https://bugzilla.wikimedia.org/
Hi, I don't have access to Bugzilla, so here is my Patch, the whole function wfTempDir() looks like that on my Mediawiki:
function wfTempDir() {
foreach( array( 'TMPDIR', 'TMP', 'TEMP' ) as $var ) {
$tmp = getenv( $var );
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
if (ini_get('upload_tmp_dir')!==false) {
$tmp = ini_get('upload_tmp_dir');
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
if( function_exists( 'sys_get_temp_dir' ) ) {
$tmp = sys_get_temp_dir();
if( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) {
return $tmp;
}
}
# Usual defaults
return wfIsWindows() ? 'C:\Windows\Temp' : '/tmp';
}