Your solution worked krossekrabbe. Thanks. Afterwards CDN was fine and everything was fine but we were receiving a lot of errors in the error log. These two changes brought the errors to zero:
line 188:
if (( strcmp( $version, ‘1.0’ ) >= 0 ) && strlen($content)) {
link 195:
@$dom->loadHTML( $content );