diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc index 91fbe3a..df9aeeb 100644 --- a/modules/aggregator/aggregator.parser.inc +++ b/modules/aggregator/aggregator.parser.inc @@ -77,6 +77,18 @@ function aggregator_parse_feed(&$data, $feed) { $xml_parser = drupal_xml_parser_create($data); xml_set_element_handler($xml_parser, 'aggregator_element_start', 'aggregator_element_end'); xml_set_character_data_handler($xml_parser, 'aggregator_element_data'); + + // libxml2 ver.2.7.0 - 2.7.2 stripping leading angle brackets bug patch + if ( + LIBXML_DOTTED_VERSION == '2.7.0' || + LIBXML_DOTTED_VERSION == '2.7.1' || + LIBXML_DOTTED_VERSION == '2.7.2' || + (LIBXML_DOTTED_VERSION == '2.7.3' && version_compare(PHP_VERSION, '5.2.9', '<' )) + ) { + $data = str_replace('<', '<', $data); + $data = str_replace('>', '>', $data); + $data = str_replace('&', '&', $data); + } if (!xml_parse($xml_parser, $data, 1)) { watchdog('aggregator', 'The feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => $feed->title, '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)), WATCHDOG_WARNING); diff --git a/modules/user/user.module b/modules/user/user.module index 06233fc..65c36a9 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -4,7 +4,6 @@ * @file * Enables the user registration and login system. */ - /** * Maximum length of username text field. */ @@ -49,7 +48,7 @@ function user_help($path, $arg) { $output .= '
' . t('User roles and permissions') . '
'; $output .= '
' . t('Roles are used to group and classify users; each user can be assigned one or more roles. By default there are two roles: anonymous user (users that are not logged in) and authenticated user (users that are registered and logged in). Depending on choices you made when you installed Drupal, the installation process may have defined more roles, and you can create additional custom roles on the Roles page. After creating roles, you can set permissions for each role on the Permissions page. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing a particular type of content, editing or creating content, administering settings for a particular module, or using a particular function of the site (such as search).', array('@permissions_user' => url('admin/people/permissions'), '@roles' => url('admin/people/permissions/roles'))) . '
'; $output .= '
' . t('Account settings') . '
'; - $output .= '
' . t('The Account settings page allows you to manage settings for the displayed name of the anonymous user role, personal contact forms, user registration, and account cancellation. On this page you can also manage settings for account personalization (including signatures and user pictures), and adapt the text for the e-mail messages that are sent automatically during the user registration process.', array('@accounts' => url('admin/config/people/accounts'))) . '
'; + $output .= '
' . t('The Account settings page allows you to manage settings for the displayed name of the anonymous user role, personal contact forms, user registration, and account cancellation. On this page you can also manage settings for account personalization (including signatures and user pictures), and adapt the text for the e-mail messages that are sent automatically during the user registration process.', array('@accounts' => url('admin/config/people/accounts'))) . '
'; $output .= ''; return $output; case 'admin/people/create': @@ -336,6 +335,7 @@ class UserController extends DrupalDefaultEntityController { // hook_user_load(). parent::attachLoad($queried_users, $revision_id); } + } /** @@ -478,7 +478,7 @@ function user_save($account, $edit = array(), $category = 'account') { // make it permanent. if (!$picture->status) { $info = image_get_info($picture->uri); - $picture_directory = file_default_scheme() . '://' . variable_get('user_picture_path', 'pictures'); + $picture_directory = file_default_scheme() . '://' . variable_get('user_picture_path', 'pictures'); // Prepare the pictures directory. file_prepare_directory($picture_directory, FILE_CREATE_DIRECTORY); @@ -516,8 +516,8 @@ function user_save($account, $edit = array(), $category = 'account') { // Reload user roles if provided. if ($account->roles != $account->original->roles) { db_delete('users_roles') - ->condition('uid', $account->uid) - ->execute(); + ->condition('uid', $account->uid) + ->execute(); $query = db_insert('users_roles')->fields(array('uid', 'rid')); foreach (array_keys($account->roles) as $rid) { @@ -610,8 +610,7 @@ function user_save($account, $edit = array(), $category = 'account') { entity_get_controller('user')->resetCache(array($account->uid)); return $account; - } - catch (Exception $e) { + } catch (Exception $e) { $transaction->rollback(); watchdog_exception('user', $e); throw $e; @@ -637,16 +636,16 @@ function user_validate_name($name) { if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)) { return t('The username contains an illegal character.'); } - if (preg_match('/[\x{80}-\x{A0}' . // Non-printable ISO-8859-1 + NBSP - '\x{AD}' . // Soft-hyphen - '\x{2000}-\x{200F}' . // Various space characters - '\x{2028}-\x{202F}' . // Bidirectional text overrides - '\x{205F}-\x{206F}' . // Various text hinting characters - '\x{FEFF}' . // Byte order mark - '\x{FF01}-\x{FF60}' . // Full-width latin - '\x{FFF9}-\x{FFFD}' . // Replacement characters - '\x{0}-\x{1F}]/u', // NULL byte and control characters - $name)) { + if (preg_match('/[\x{80}-\x{A0}' . // Non-printable ISO-8859-1 + NBSP + '\x{AD}' . // Soft-hyphen + '\x{2000}-\x{200F}' . // Various space characters + '\x{2028}-\x{202F}' . // Bidirectional text overrides + '\x{205F}-\x{206F}' . // Various text hinting characters + '\x{FEFF}' . // Byte order mark + '\x{FF01}-\x{FF60}' . // Full-width latin + '\x{FFF9}-\x{FFFD}' . // Replacement characters + '\x{0}-\x{1F}]/u', // NULL byte and control characters + $name)) { return t('The username contains an illegal character.'); } if (drupal_strlen($name) > USERNAME_MAX_LENGTH) { @@ -832,10 +831,10 @@ function user_access($string, $account = NULL) { */ function user_is_blocked($name) { return db_select('users') - ->fields('users', array('name')) - ->condition('name', db_like($name), 'LIKE') - ->condition('status', 0) - ->execute()->fetchObject(); + ->fields('users', array('name')) + ->condition('name', db_like($name), 'LIKE') + ->condition('status', 0) + ->execute()->fetchObject(); } /** @@ -843,7 +842,7 @@ function user_is_blocked($name) { */ function user_permission() { return array( - 'administer permissions' => array( + 'administer permissions' => array( 'title' => t('Administer permissions'), 'restrict access' => TRUE, ), @@ -888,11 +887,11 @@ function user_file_move($file, $source) { // the users table. if (isset($file->fid) && isset($source->fid) && $file->fid != $source->fid) { db_update('users') - ->fields(array( - 'picture' => $file->fid, - )) - ->condition('picture', $source->fid) - ->execute(); + ->fields(array( + 'picture' => $file->fid, + )) + ->condition('picture', $source->fid) + ->execute(); } } @@ -902,9 +901,9 @@ function user_file_move($file, $source) { function user_file_delete($file) { // Remove any references to the file. db_update('users') - ->fields(array('picture' => 0)) - ->condition('picture', $file->fid) - ->execute(); + ->fields(array('picture' => 0)) + ->condition('picture', $file->fid) + ->execute(); } /** @@ -937,19 +936,19 @@ function user_search_execute($keys = NULL, $conditions = NULL) { // and they don't need to be restricted to only active users. $query->fields('users', array('mail')); $query->condition(db_or()-> - condition('name', '%' . db_like($keys) . '%', 'LIKE')-> - condition('mail', '%' . db_like($keys) . '%', 'LIKE')); + condition('name', '%' . db_like($keys) . '%', 'LIKE')-> + condition('mail', '%' . db_like($keys) . '%', 'LIKE')); } else { // Regular users can only search via usernames, and we do not show them // blocked accounts. $query->condition('name', '%' . db_like($keys) . '%', 'LIKE') - ->condition('status', 1); + ->condition('status', 1); } $uids = $query - ->limit(15) - ->execute() - ->fetchCol(); + ->limit(15) + ->execute() + ->fetchCol(); $accounts = user_load_multiple($uids); $results = array(); @@ -1024,7 +1023,7 @@ function user_account_form(&$form, &$form_state) { // Account information. $form['account'] = array( - '#type' => 'container', + '#type' => 'container', '#weight' => -10, ); // Only show name field on registration form or user can change own username. @@ -1295,9 +1294,9 @@ function user_user_presave(&$edit, $account, $category) { */ function user_user_categories() { return array(array( - 'name' => 'account', - 'title' => t('Account settings'), - 'weight' => 1, + 'name' => 'account', + 'title' => t('Account settings'), + 'weight' => 1, )); } @@ -1728,14 +1727,14 @@ function user_menu() { // Administration pages. $items['admin/config/people'] = array( - 'title' => 'People', - 'description' => 'Configure user accounts.', - 'position' => 'left', - 'weight' => -20, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', - 'file path' => drupal_get_path('module', 'system'), + 'title' => 'People', + 'description' => 'Configure user accounts.', + 'position' => 'left', + 'weight' => -20, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + 'file' => 'system.admin.inc', + 'file path' => drupal_get_path('module', 'system'), ); $items['admin/config/people/accounts'] = array( 'title' => 'Account settings', @@ -2042,18 +2041,18 @@ function user_set_authmaps($account, $authmaps) { $module = explode('_', $key, 2); if ($value) { db_merge('authmap') - ->key(array( - 'uid' => $account->uid, - 'module' => $module[1], - )) - ->fields(array('authname' => $value)) - ->execute(); + ->key(array( + 'uid' => $account->uid, + 'module' => $module[1], + )) + ->fields(array('authname' => $value)) + ->execute(); } else { db_delete('authmap') - ->condition('uid', $account->uid) - ->condition('module', $module[1]) - ->execute(); + ->condition('uid', $account->uid) + ->condition('module', $module[1]) + ->execute(); } } } @@ -2255,9 +2254,9 @@ function user_login_finalize(&$edit = array()) { // This is also used to invalidate one-time login links. $user->login = REQUEST_TIME; db_update('users') - ->fields(array('login' => $user->login)) - ->condition('uid', $user->uid) - ->execute(); + ->fields(array('login' => $user->login)) + ->condition('uid', $user->uid) + ->execute(); // Regenerate the session ID to prevent against session fixation attacks. // This is called before hook_user in case one of those functions fails @@ -2501,16 +2500,15 @@ function user_delete_multiple(array $uids) { } db_delete('users') - ->condition('uid', $uids, 'IN') - ->execute(); + ->condition('uid', $uids, 'IN') + ->execute(); db_delete('users_roles') - ->condition('uid', $uids, 'IN') - ->execute(); + ->condition('uid', $uids, 'IN') + ->execute(); db_delete('authmap') - ->condition('uid', $uids, 'IN') - ->execute(); - } - catch (Exception $e) { + ->condition('uid', $uids, 'IN') + ->execute(); + } catch (Exception $e) { $transaction->rollback(); watchdog_exception('user', $e); throw $e; @@ -2825,7 +2823,7 @@ function user_mail_tokens(&$replacements, $data, $options) { } } -/*** Administrative features ***********************************************/ +/* * * Administrative features ********************************************** */ /** * Retrieve an array of roles matching specified conditions. @@ -2886,10 +2884,10 @@ function user_roles($membersonly = FALSE, $permission = NULL) { */ function user_role_load($rid) { return db_select('role', 'r') - ->fields('r') - ->condition('rid', $rid) - ->execute() - ->fetchObject(); + ->fields('r') + ->condition('rid', $rid) + ->execute() + ->fetchObject(); } /** @@ -2906,10 +2904,10 @@ function user_role_load($rid) { */ function user_role_load_by_name($role_name) { return db_select('role', 'r') - ->fields('r') - ->condition('name', $role_name) - ->execute() - ->fetchObject(); + ->fields('r') + ->condition('name', $role_name) + ->execute() + ->fetchObject(); } /** @@ -2970,15 +2968,15 @@ function user_role_delete($role) { } db_delete('role') - ->condition('rid', $role->rid) - ->execute(); + ->condition('rid', $role->rid) + ->execute(); db_delete('role_permission') - ->condition('rid', $role->rid) - ->execute(); + ->condition('rid', $role->rid) + ->execute(); // Update the users who have this role set: db_delete('users_roles') - ->condition('rid', $role->rid) - ->execute(); + ->condition('rid', $role->rid) + ->execute(); module_invoke_all('user_role_delete', $role); @@ -3074,14 +3072,14 @@ function user_role_grant_permissions($rid, array $permissions = array()) { // Grant new permissions for the role. foreach ($permissions as $name) { db_merge('role_permission') - ->key(array( - 'rid' => $rid, - 'permission' => $name, - )) - ->fields(array( - 'module' => $modules[$name], - )) - ->execute(); + ->key(array( + 'rid' => $rid, + 'permission' => $name, + )) + ->fields(array( + 'module' => $modules[$name], + )) + ->execute(); } // Clear the user access cache. @@ -3103,9 +3101,9 @@ function user_role_grant_permissions($rid, array $permissions = array()) { function user_role_revoke_permissions($rid, array $permissions = array()) { // Revoke permissions for the role. db_delete('role_permission') - ->condition('rid', $rid) - ->condition('permission', $permissions, 'IN') - ->execute(); + ->condition('rid', $rid) + ->condition('permission', $permissions, 'IN') + ->execute(); // Clear the user access cache. drupal_static_reset('user_access'); @@ -3306,10 +3304,7 @@ function user_multiple_cancel_confirm($form, &$form_state) { '#description' => t('When enabled, the user will receive an e-mail notification after the account has been cancelled.'), ); - return confirm_form($form, - t('Are you sure you want to cancel these user accounts?'), - 'admin/people', t('This action cannot be undone.'), - t('Cancel accounts'), t('Cancel')); + return confirm_form($form, t('Are you sure you want to cancel these user accounts?'), 'admin/people', t('This action cannot be undone.'), t('Cancel accounts'), t('Cancel')); } /** @@ -3371,7 +3366,7 @@ function user_filters() { 'title' => t('role'), 'field' => 'ur.rid', 'options' => array( - '[any]' => t('any'), + '[any]' => t('any'), ) + $roles, ); } @@ -3390,7 +3385,7 @@ function user_filters() { $filters['permission'] = array( 'title' => t('permission'), 'options' => array( - '[any]' => t('any'), + '[any]' => t('any'), ) + $options, ); @@ -3433,7 +3428,7 @@ function user_build_filter_query(SelectQuery $query) { } elseif ($key == 'role') { $users_roles_alias = $query->join('users_roles', 'ur', '%alias.uid = u.uid'); - $query->condition($users_roles_alias . '.rid' , $value); + $query->condition($users_roles_alias . '.rid', $value); } else { $query->condition($filters[$key]['field'], $value); @@ -3737,8 +3732,8 @@ function user_register_form($form, &$form_state) { // inside the submit function interferes with form processing and breaks // hook_form_alter(). $form['administer_users'] = array( - '#type' => 'value', - '#value' => $admin, + '#type' => 'value', + '#value' => $admin, ); // If we aren't admin but already logged on, go to the user page instead. @@ -3895,9 +3890,9 @@ function user_modules_installed($modules) { * Implements hook_modules_uninstalled(). */ function user_modules_uninstalled($modules) { - db_delete('role_permission') - ->condition('module', $modules, 'IN') - ->execute(); + db_delete('role_permission') + ->condition('module', $modules, 'IN') + ->execute(); } /**