In case anyone else stumbles on this looking for an answer, when upgrading isn't possible, change line 328:
parse_str(parse_url(@$_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $get);
to
parse_str(parse_url(parse_url(@$_SERVER['HTTP_REFERER'], PHP_URL_QUERY), PHP_URL_QUERY), $get);
The URLs in 2.8 add an additional "?" to the query string (e.g. "/system/index.php?/cp/content_publish/entry_form?channel_id=22") because of this the parse_url
function doesn't properly parse the URL and thus creates issues for the rest of the cp_js_end
function.
Also worth noting is that line 432 should also be updated to work with the new input field format (i.e. the removal of the ID attribute).
change line 432 from:
$out .= '$("#title").attr("maxlength", "'.$max_title.'");';
to
$out .= '$("[name=\'title\']").attr("maxlength", "'.$max_title.'");';