Nothing will run after a return, plus this will make filtersie work in php7.

Comments

drikc’s picture

Hello,

What does php7 complain for this portion of code?

PS: the code is the one from http://vikjavev.no/computing/ump.php and is inserted in filtersie "as a library".

derjochenmeyer’s picture

StatusFileSize
new353 bytes

Its enough to remove the useless break to resolve the error. What so ever the first patch fixes an addtional error.

   if ($radius == 0) {
     return $img;
     imagedestroy($img);
-    break;
   }

Drush teriminates with the following error on every site that uses FiltersIE, since Drush sometimes uses a different PHP version, this error makes drush unusable even on sites running PHP 5.x.

Drush command terminated abnormally due to an unrecoverable error.                                                                                                                      [error]
Error: 'break' not in the 'loop' or 'switch' context in ./sites/all/modules/filtersie/filtersie.gd.inc, line 71

Fatal error: 'break' not in the 'loop' or 'switch' context in ./sites/all/modules/filtersie/filtersie.gd.inc on line 71

  • drikc committed e1806e1 on 7.x-1.x authored by derjochenmeyer
    Issue #2503541 by joshtaylor, derjochenmeyer: break after return in...
drikc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hkirsman’s picture

Why is the 'imagedestroy($img);' there. It's not executed because it's after return..

drikc’s picture

See comment #1; that code was inserted as it is: http://vikjavev.no/computing/ump.php

hkirsman’s picture

ok, but it still doesn't make sense :)