fltr[]=wmi and PHP 5.6

Post here if you think you found a bug in phpThumb
Post Reply
Posts: 2
Joined: Thu Nov 20, 2008 6:08 am

fltr[]=wmi and PHP 5.6

Post by jaro » Thu Jun 02, 2016 5:50 am

Hi -

I seem to have Problems with the wmi filter parameter preparation after moving phpthumb to a server with PHP 5.6:
Using the wmi filter now throws some warnings about wrong array indizes.

After some debugging i found that the variable $margin (which supposed to be an array) only contains the string '1' after executing

Code: Select all

@list($filename, $alignment, $opacity, $margin['x'], $margin['y'], $rotate_angle) = explode('|', $parameter, 6);
around line 2848 in phpthumb.class.php.

This works fine on my server with PHP 5.4 but not on the new one.

After changing the code to

Code: Select all

@list($filename, $alignment, $opacity, $marginX, $marginY, $rotate_angle) = explode('|', $parameter, 6);
$margin = array('x'=>$marginX, 'y'=>$marginY);
it works again.

There seems to be some subtle change in the list command since 5.6 or some kind of race condition in my thumbnail parameter situation.

BR from Salzburg!

- Johannes

James Heinrich
Site Admin
Posts: 436
Joined: Tue May 27, 2008 8:36 am
Are you a spambot?: no
Location: Northern Ontario, Canada

Re: fltr[]=wmi and PHP 5.6

Post by James Heinrich » Thu Jun 02, 2016 11:12 am

I tried that line in PHP Sandbox under various PHP versions and it seemed to always work as expected, from v4.4 to v7.0 (there was a minor variation with v7 where the x/y keys of $margin were returned in the opposite order compared to previous version, but we already knew that from the PHP 7 changelog.

Perhaps you want to un-error-suppress the list command and see if it generates any more useful error messages. Or if you can track down specifically what's happening and why I'd be interested.

I haven't been to Salzburg since 1994, but it seemed a nice place.

Post Reply