[BUGFIX] Unnecessary warning in css_styled_content (division by zero)
authorThomas Layh <thomas@layh.com>
Wed, 2 May 2012 14:10:06 +0000 (16:10 +0200)
committerErnesto Baschny <ernst@cron-it.de>
Wed, 18 Jul 2012 09:20:09 +0000 (11:20 +0200)
commit71781f1010209cb841bc309344315c9d48dde123
treec6438d2c04cc1fcadc068c2c2d3d4c06b374cc93
parent218f304d23de7e6498ce6fb0359dfbf40fe4a096
[BUGFIX] Unnecessary warning in css_styled_content (division by zero)

If tt_content.image.20.maxW is not set, PHP throws a warning about
division by zero. This is not necessary. After that the variable
$scale is not set. This patch checks if $netW is greater zero and
otherwise the else condition will set $scale to 1.

Change-Id: Icd876b33d543080e486e0184c8af34c9a3831738
Fixes: #36777
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/12865
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php