diff --git a/drupal/sites/default/boinc/modules/boincimport/boincimport.module b/drupal/sites/default/boinc/modules/boincimport/boincimport.module index 698eb9fde2b..8a79c7f99c9 100644 --- a/drupal/sites/default/boinc/modules/boincimport/boincimport.module +++ b/drupal/sites/default/boinc/modules/boincimport/boincimport.module @@ -241,10 +241,11 @@ function boincimport_process_form() { //ini_set('display_errors', TRUE); // Adjust how long you want the script to run... - if (!ini_get('safe_mode')) { - set_time_limit(variable_get('boincimport_time_limit', 0)); - } - + if (!ini_get('safe_mode')) { + // This will always be set on PHP7, but not on PHP5 with safe mode + set_time_limit(variable_get('boincimport_time_limit', 0)); + } + // Check for a lock on the import process if (variable_get('boincimport_process_locked', 0)) { drupal_set_message(t('The import process is locked. If you are sure that @@ -477,7 +478,7 @@ function boincimport_users() { SELECT id FROM {user} ORDER BY id ASC' ); - $user_count = mysql_num_rows($boinc_accounts); + $user_count = mysqli_num_rows($boinc_accounts); } else { // Need to import any user who is currently ignored in order to keep them @@ -508,7 +509,7 @@ function boincimport_users() { ) AS usersToImport", implode(',', $ignored_user_list) ); - $user_count = mysql_num_rows($boinc_accounts); + $user_count = mysqli_num_rows($boinc_accounts); } db_set_active('default'); @@ -745,7 +746,7 @@ function boincimport_teams() { FROM %steam', $pre ); - $team_count = mysql_num_rows($boinc_teams); + $team_count = mysqli_num_rows($boinc_teams); db_set_active('default'); if (!$team_count) { @@ -924,7 +925,7 @@ function boincimport_friends() { ORDER BY create_time', $pre, $pre ); - $friendship_count = mysql_num_rows($friendships); + $friendship_count = mysqli_num_rows($friendships); db_set_active('default'); if (!$friendship_count) { @@ -1093,7 +1094,7 @@ function boincimport_preferences() { WHERE ignorelist <> ''", $pre ); - $quarreler_count = mysql_num_rows($quarrelers); + $quarreler_count = mysqli_num_rows($quarrelers); db_set_active('default'); if (!$quarreler_count) { @@ -1274,7 +1275,7 @@ function boincimport_private_msgs() { FROM %sprivate_messages', $pre ); - $private_msg_count = mysql_num_rows($boinc_private_msgs); + $private_msg_count = mysqli_num_rows($boinc_private_msgs); db_set_active('default'); if (!$private_msg_count) { @@ -1471,7 +1472,7 @@ function boincimport_forum_categories() { ORDER BY orderID', $pre ); - $forum_category_count = mysql_num_rows($boinc_forum_categories); + $forum_category_count = mysqli_num_rows($boinc_forum_categories); $boinc_forums = db_query(' SELECT id, category, title, description, orderID FROM %sforum @@ -1479,7 +1480,7 @@ function boincimport_forum_categories() { ORDER BY category', $pre ); - $forum_count = mysql_num_rows($boinc_forums); + $forum_count = mysqli_num_rows($boinc_forums); db_set_active('default'); if (!$forum_category_count) { @@ -2573,7 +2574,7 @@ function boincimport_team_forums() { ORDER BY id ASC', $pre ); - $team_forum_count = mysql_num_rows($boincteam_forums); + $team_forum_count = mysqli_num_rows($boincteam_forums); db_set_active('default'); if (!$team_forum_count) { @@ -2772,7 +2773,7 @@ function boincimport_team_forum_topics() { ORDER BY id', $pre, $pre, $pre ); - $boincteam_topic_count = mysql_num_rows($boincteam_topics); + $boincteam_topic_count = mysqli_num_rows($boincteam_topics); $total_team_topic_count = db_result(db_query(' SELECT COUNT(*) FROM %sthread t JOIN %sforum f ON f.id = t.forum @@ -3319,7 +3320,7 @@ function boincimport_subscriptions() { ORDER BY userid ASC', $pre ); - $user_count = mysql_num_rows($users_with_subscriptions); + $user_count = mysqli_num_rows($users_with_subscriptions); db_set_active('default'); if (!$user_count) { @@ -3997,7 +3998,7 @@ class BoincImportUrlTransformer { /** * Constructor */ - function BoincImportUrlTransformer() { + function __construct() { global $base_url; global $base_path; $boinc_base_urls = variable_get('boincimport_base_url_boinc', ''); @@ -4017,6 +4018,11 @@ class BoincImportUrlTransformer { array(), WATCHDOG_WARNING); } } + + // old-style constructor for backwards compatibility + function BoincImportUrlTransformer() { + self::__construct(); + } /** * Get what the new base URL should be (needed for every transformation) diff --git a/drupal/sites/default/boinc/modules/boincwork/includes/boincwork.forms.inc b/drupal/sites/default/boinc/modules/boincwork/includes/boincwork.forms.inc index 00555a2944f..9dcd254d6e0 100644 --- a/drupal/sites/default/boinc/modules/boincwork/includes/boincwork.forms.inc +++ b/drupal/sites/default/boinc/modules/boincwork/includes/boincwork.forms.inc @@ -669,7 +669,7 @@ function boincwork_generalprefs_form_submit($form, &$form_state) { $result = boincwork_save_prefs($prefs, 'general', $venue); if (!$result) { - watchdog('boincwork', 'Error updating global prefs for user @id: @message', array('@id' => $account->id, '@message' => mysql_error()), WATCHDOG_ERROR); + watchdog('boincwork', 'Error updating global prefs for user @id: @message', array('@id' => $account->id, '@message' => mysqli_error()), WATCHDOG_ERROR); drupal_set_message(t('Your changes could not be saved. Please contact support!'), 'error'); } elseif (!drupal_get_messages('status', FALSE)) { @@ -1363,7 +1363,7 @@ function boincwork_projectprefs_form_submit($form, &$form_state) { } if (!$result) { - watchdog('boincwork', 'Error updating project prefs for user @id: @message', array('@id' => $user->id, '@message' => mysql_error()), WATCHDOG_ERROR); + watchdog('boincwork', 'Error updating project prefs for user @id: @message', array('@id' => $user->id, '@message' => mysqli_error()), WATCHDOG_ERROR); drupal_set_message(t('Your changes could not be saved. Please contact support!'), 'error'); } elseif (!drupal_get_messages('status', FALSE)) {