Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.537.2.24 diff -u -F^f -r1.537.2.24 common.inc --- includes/common.inc 26 Jul 2007 19:17:24 -0000 1.537.2.24 +++ includes/common.inc 17 Oct 2007 21:05:39 -0000 @@ -235,10 +235,6 @@ function drupal_get_destination() { * 'user login'-block in a sidebar. The function drupal_get_destination() * can be used to help set the destination URL. * - * It is advised to use drupal_goto() instead of PHP's header(), because - * drupal_goto() will append the user's session ID to the URI when PHP is - * compiled with "--enable-trans-sid". - * * This function ends the request; use it rather than a print theme('page') * statement in your menu callback. * @@ -260,6 +256,8 @@ function drupal_goto($path = '', $query } $url = url($path, $query, $fragment, TRUE); + // Remove newlines from the URL to avoid header injection attacks. + $url = str_replace(array("\n", "\r"), '', $url); // Before the redirect, allow modules to react to the end of the page request. module_invoke_all('exit', $url);