From 14c1c505e0b5915ff85f0698afc209f530fd83fb Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 1 Nov 2009 23:02:13 +0000 Subject: #607008 by dww, Gerhard Killesreiter, JacobSingh, and chx: Changed Fix bugs in https support and use https for authorize.php if available. --- modules/system/system.module | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.module b/modules/system/system.module index c7be27e97..76ea92269 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1504,10 +1504,19 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti /** * Return the URL for the authorize.php script. + * + * @param array $options + * Optional array of options to pass to url(). + * @return + * The full URL to authorize.php, using https if available. */ -function system_authorized_get_url() { +function system_authorized_get_url(array $options = array()) { global $base_url; - return $base_url . '/authorize.php'; + // Force https if available, regardless of what the caller specifies. + $options['https'] = TRUE; + // We prefix with $base_url so we get a full path even if clean URLs are + // disabled. + return url($base_url . '/authorize.php', $options); } /** @@ -1520,6 +1529,17 @@ function system_authorized_run($callback, $file, $arguments = array(), $page_tit drupal_goto(system_authorized_get_url()); } +/** + * Use authorize.php to run batch_process(). + * + * @see batch_process() + */ +function system_authorized_batch_process() { + $finish_url = system_authorized_get_url(); + $process_url = system_authorized_get_url(array('query' => array('batch' => '1'))); + batch_process($finish_url, $process_url); +} + /** * @} End of "defgroup authorize". */ -- cgit v1.2.3