dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.4k stars 77 forks source link

Fixed attribute issue #41

Closed mmartel-opinionsystem closed 4 years ago

mmartel-opinionsystem commented 6 years ago

Fix for bug #40

UCIS commented 5 years ago

$this->attributes does get set by the svgOffset method; shouldn't the code use the local variable and check if it's actually an array? if (is_array($this->attributes) && count($this->attributes)) {

bsweeney commented 4 years ago

This doesn't look like the correct solution. The apparent affect on the rendered image appears to be negligible (based on some very basic testing), but the logic is a potentially significant departure. Current logic looks to be:

With your change the logic would be:

Could your local install be an older version of php-svg-lib? As of 0.3.0 the attributes property is initialized to an array in order to avoid this issue (see 4909031bdabdc802cf49912d631690cb44b0240d).