Thumbnails didn't work since Update to 1.19

Fragment of a discussion from Talk:MediaWiki 1.19
Jump to: navigation, search

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

91.89.83.21216:40, 5 May 2012

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';
}
212.21.161.8809:44, 9 May 2012

You do have access to Bugzilla: https://bugzilla.wikimedia.org/

MarkAHershberger(talk)12:18, 9 May 2012
 

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';
}
212.21.161.8809:44, 9 May 2012