diff --git a/core/includes/file.inc b/core/includes/file.inc index 133d64f..4cae398 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1947,13 +1947,17 @@ function file_transfer($uri, $headers) { * If the file exists but no modules responded an AccessDeniedHttpException will * be thrown.If the file does not exist a NotFoundHttpException will be thrown. * + * @param string $scheme + * A URI scheme, a stream is referenced as "scheme://target". + * * @see hook_file_download() * @see system_menu() */ -function file_download() { +function file_download($scheme) { // Merge remaining path arguments into relative file path. $args = func_get_args(); - $scheme = array_shift($args); + // Remove $scheme from the arguments. + unset($args[0]); $target = implode('/', $args); $uri = $scheme . '://' . $target; if (file_stream_wrapper_valid_scheme($scheme) && file_exists($uri)) { diff --git a/core/includes/form.inc b/core/includes/form.inc index 471db5a..7b27840 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -128,7 +128,7 @@ function drupal_get_form($form_id) { $args = func_get_args(); // Remove $form_id from the arguments. - array_shift($args); + unset($args[0]); $form_state['build_info']['args'] = $args; return drupal_build_form($form_id, $form_state); @@ -3821,8 +3821,7 @@ function theme_vertical_tabs($variables) { * $args = func_get_args(); * // We need to remove $arg1 and $arg2 from the beginning of the array so we * // are left with the keywords. - * array_shift($args); - * array_shift($args); + * unset($args[0], $args[1]); * // We store the user's original input in $keywords, including any slashes. * $keywords = implode('/', $args); * diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc index 879d685..1688704 100644 --- a/core/modules/taxonomy/taxonomy.pages.inc +++ b/core/modules/taxonomy/taxonomy.pages.inc @@ -111,8 +111,8 @@ function taxonomy_autocomplete($field_name, $tags_typed = '') { // If the request has a '/' in the search text, then the menu system will have // split it into multiple arguments, recover the intended $tags_typed. $args = func_get_args(); - // Shift off the $field_name argument. - array_shift($args); + // Remove $field_name from the arguments. + unset($args[0]); $tags_typed = implode('/', $args); // Make sure the field exists and is a taxonomy field.