franz-josef-kaiser/Dynamic-Image-Resize — pull request #4 by toomuchdesign (2013-09-03 09:50:48+00:00)
Title: hw_markup added to make width/height html markup optional.

This version works in in both template and shortcode mode.
Removed long else/if logic in get_markup().

Faced some trouble with sanitize function because it trims all the attributes: normally trim it's ok, but it behaves weird with booleans. So it returns:

'1' when receives true
and
'' when receives false.

Catching booleans (expecially false) values after a trim operation is quite hard. That's why line 99 looks that way!
After trimming, a false value looks almost almost the same way as a blank value.

99th line gets 'hw_markup' after trimming operation, and re-assign to it a true or false value. I think It doesn't need any escaping. The only way I found to detect the trimmed-false boolean is a === comparison.

I tried to make it working with no changes in code logic.

Possible workarounds:
1- write a regular expression function in place of the standard php trim
2- Invert 'hw_markup' attr logic and make it false by default.