anchorcms/anchor-cms

Undefined variable "ext" when saving custom image field

marceickhoff opened this issue · 3 comments

Summary

The method resizeImage in anchor/models/extend.php causes an exception because the variable ext is undefined. This happens when saving (and resizing) an image from a custom image field.

Expected Behaviour

The variable ext should contain the image file extension.

Actual Behaviour

It doesn't. It's undefined.

Context details

  • Anchor version: 0.12.6

Possible solution

Define the variable:

$ext = pathinfo($filepath, PATHINFO_EXTENSION);

@marceickhoff Will take a look when I look at #1259

@CraigChilds94 We create the pathInfo, we just don't use it: anchor/models/extend.php#L209

Closing because #1306 fixes this.