Commit 938c7c07 authored by Dries's avatar Dries

- Patch #360605 by Berdir: made CVS HEAD compatible with PHP5.3.

parent 4488b248
......@@ -1100,7 +1100,7 @@ function file_validate_size($file, $file_limit = 0, $user_limit = 0) {
*
* @see hook_file_validate()
*/
function file_validate_is_image(&$file) {
function file_validate_is_image($file) {
$errors = array();
$info = image_get_info($file->filepath);
......@@ -1135,7 +1135,7 @@ function file_validate_is_image(&$file) {
*
* @see hook_file_validate()
*/
function file_validate_image_resolution(&$file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
function file_validate_image_resolution($file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
$errors = array();
// Check first that the file is an image.
......
......@@ -291,6 +291,10 @@ function form_set_cache($form_build_id, $form, $form_state) {
*/
function drupal_execute($form_id, &$form_state) {
$args = func_get_args();
// Make sure $form_state is passed around by reference.
$args[1] = &$form_state;
$form = call_user_func_array('drupal_retrieve_form', $args);
$form['#post'] = $form_state['values'];
drupal_prepare_form($form_id, $form, $form_state);
......
......@@ -705,7 +705,7 @@ function comment_nodeapi_rss_item($node) {
/**
* Implementation of hook_user_cancel().
*/
function comment_user_cancel(&$edit, &$account, $method) {
function comment_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
db_update('comment')->fields(array('status' => 0))->condition('uid', $account->uid)->execute();
......
......@@ -104,7 +104,7 @@ function dblog_cron() {
/**
* Implementation of hook_user_cancel().
*/
function dblog_user_cancel(&$edit, &$account, $method) {
function dblog_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
db_update('watchdog')->fields(array('uid' => 0))->condition('uid', $account->uid)->execute();
......
......@@ -1481,7 +1481,7 @@ function node_ranking() {
/**
* Implementation of hook_user_cancel().
*/
function node_user_cancel(&$edit, &$account, $method) {
function node_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish nodes (current revisions).
......
......@@ -817,7 +817,7 @@ function poll_cancel($form, &$form_state) {
/**
* Implementation of hook_user_cancel().
*/
function poll_user_cancel(&$edit, &$account, $method) {
function poll_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
db_update('poll_vote')->fields(array('uid' => 0))->condition('uid', $account->uid)->execute();
......
......@@ -254,7 +254,7 @@ function profile_user_validate(&$edit, &$user, $category = NULL) {
/**
* Implementation of hook_user_categories().
*/
function profile_user_categories(&$edit, &$user, $category = NULL) {
function profile_user_categories($edit, $user, $category = NULL) {
return profile_categories();
}
......
......@@ -147,7 +147,9 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
$this->assertAssertion('This is nothing.', 'Other', 'Pass', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
// Check that errors that occur inside PHP internal functions are correctly reported.
$this->assertAssertion('The second argument should be either an array or an object', 'Warning', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
// The exact error message differs between PHP versions so we check only
// the function name 'array_key_exists'.
$this->assertAssertion('array_key_exists', 'Warning', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
$this->test_ids[] = $test_id = $this->getTestIdFromResults();
$this->assertTrue($test_id, t('Found test ID in results.'));
......
......@@ -186,7 +186,7 @@ function statistics_menu() {
/**
* Implementation of hook_user_cancel().
*/
function statistics_user_cancel(&$edit, &$account, $method) {
function statistics_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
db_update('accesslog')->fields(array('uid' => 0))->condition('uid', $account->uid)->execute();
......
......@@ -2046,7 +2046,7 @@ function theme_system_admin_by_module($menu_items) {
* An array of requirements.
* @ingroup themeable
*/
function theme_status_report(&$requirements) {
function theme_status_report($requirements) {
$i = 0;
$output = '<table class="system-status-report">';
foreach ($requirements as $requirement) {
......
......@@ -422,7 +422,7 @@ function trigger_user_login(&$edit, &$account, $category) {
/**
* Implementation of hook_user_logout().
*/
function trigger_user_logout(&$edit, &$account) {
function trigger_user_logout($edit, $account) {
_trigger_user('logout', $edit, $account);
}
......@@ -443,7 +443,7 @@ function trigger_user_update(&$edit, &$account, $category) {
/**
* Implementation of hook_user_cancel().
*/
function trigger_user_cancel(&$edit, &$account, $method) {
function trigger_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
case 'user_cancel_delete':
......
......@@ -282,7 +282,7 @@ function upload_file_load($files) {
/**
* Implementation of hook_file_references().
*/
function upload_file_references(&$file) {
function upload_file_references($file) {
// If upload.module is still using a file, do not let other modules delete it.
$count = db_query('SELECT COUNT(*) FROM {upload} WHERE fid = :fid', array(':fid' => $file->fid))->fetchField();
if ($count) {
......@@ -294,7 +294,7 @@ function upload_file_references(&$file) {
/**
* Implementation of hook_file_delete().
*/
function upload_file_delete(&$file) {
function upload_file_delete($file) {
// Delete all information associated with the file.
db_delete('upload')->condition('fid', $file->fid)->execute();
}
......@@ -604,7 +604,7 @@ function _upload_form($node) {
*
* @ingroup themeable
*/
function theme_upload_form_current(&$form) {
function theme_upload_form_current($form) {
$header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size'));
drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
......
......@@ -94,9 +94,9 @@ function hook_user($op, &$edit, &$account, $category = NULL) {
*
* Expensive operations should be added to the global batch with batch_set().
*
* @param &$edit
* @param $edit
* The array of form values submitted by the user.
* @param &$account
* @param $account
* The user object on which the operation is being performed.
* @param $method
* The account cancellation method.
......@@ -105,7 +105,7 @@ function hook_user($op, &$edit, &$account, $category = NULL) {
* @see hook_user_cancel_methods_alter()
* @see user_cancel()
*/
function hook_user_cancel(&$edit, &$account, $method) {
function hook_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish nodes (current revisions).
......
......@@ -790,7 +790,7 @@ function user_user_submit(&$edit, &$account, $category = NULL) {
/**
* Implementation of hook_user_categories.
*/
function user_user_categories(&$edit, &$account, $category = NULL) {
function user_user_categories($edit, $account, $category = NULL) {
return array(array('name' => 'account', 'title' => t('Account settings'), 'weight' => 1));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment