Description
ImagePlugin defaultQuality property makes an incorrect check to see if value is Number.
In the com.xpn.xwiki.plugin.image.ImagePlugin class under xwiki-platform-oldcore at line 127 where the class checks to see if the xwiki.plugin.image.defaultQuality paramater is a number the code uses:
StringUtils.isNumeric(defaultQualityParam.trim())
however, based on the documentation (and observed behavior) the method will reject any value with a dot. For example 0.5 will be rejected since the StringUtils documentation for isNumeric (http://commons.apache.org/lang/api-2.3/org/apache/commons/lang/StringUtils.html#isNumeric%28java.lang.String%29) says:
"Checks if the String contains only unicode digits. A decimal point is not a unicode digit and returns false."
Thus the only value which is accepted will be 1.
A way to do this would be to use FloatValidator.validate and check for null value:
or the check could be skipped entirely since Float.parseFloat will throw an exception anyway and the system will use the default value.