getdave / wp-intervention

On-demand image manipulation for WordPress via the Intervention Library.
26 stars 7 forks source link

Stripping callables from args when creating cache path #2

Closed jonpearse closed 7 years ago

jonpearse commented 7 years ago

As promised a few weeks ago =)

Intervention allows you to pass closures as parameters to some functions (see the callback param). Doing so causes issues with cache filename generation, as PHP is unable to serialise/hash them properly. This is a quick and dirty patch to strip any callables from the argument array before using it to generate the cache filename.

[edit] Apologies for the irritating whitespace changes: that’d be Atom trying to be useful, then… [/edit]

getdave commented 7 years ago

Thanks Jon. All merged. Much appreciated.