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

php7 rightfully rejects this bit since the break is invalid in this context not to mention that code cannot be executed since it is after the return

Files: 
CommentFileSizeAuthor
#3 invalid_syntax_logic-2639570-3.patch435 bytesjoelpittet

Comments

boombatower created an issue. See original summary.

boombatower’s picture

simple solution was to drop this code, but present in 6.x as well

joelpittet’s picture

Status: Active » Needs review
FileSize
435 bytes

Removing unexecuted code.

drclaw’s picture

Patch looks good and applies cleanly. TBH I'm actually not 100% sure how to test it, but I'm pretty confident the removed code would never be run anyway since it's after the return statement so I'm happy to call this RTBC.

Does it matter that the function is pulled from http://vikjavev.no/computing/ump.php and that the extraneous code is in that source as well?

joelpittet’s picture

Nice find, I didn't noticed that but at least the copyright is left in there. There doesn't seem to be a license attached to that bit of code and the author suggests copying it.

mike503’s picture

+1 the fix is correct.

joelpittet’s picture

@mike503, if the fix works in your testing please set the status to "Reviewed and Tested by the community"

mike503’s picture

Status: Needs review » Reviewed & tested by the community