Fix deprecated preg_replace with /e option. Remove naughty JS trying to
set content-length.