Commit a24a6c2b authored by Dries's avatar Dries

- Patch #471070 by stella: millions of code style fixes.

parent a5f42fd0
......@@ -1091,7 +1091,7 @@ public function __toString() {
// If the table is a subquery, compile it and integrate it into this query.
if ($table['table'] instanceof SelectQueryInterface) {
$table_string = '(' . (string)$table['table'] .')';
$table_string = '(' . (string)$table['table'] . ')';
}
else {
$table_string = '{' . $this->connection->escapeTable($table['table']) . '}';
......
......@@ -1878,7 +1878,7 @@ function file_get_mimetype($filename, $mapping = NULL) {
));
}
foreach ($mapping as $ext_preg => $mime_match) {
if (preg_match('!\.('. $ext_preg .')$!i', $filename)) {
if (preg_match('!\.(' . $ext_preg . ')$!i', $filename)) {
return $mime_match;
}
}
......
......@@ -414,7 +414,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
function drupal_get_install_files($module_list = array()) {
$installs = array();
foreach ($module_list as $module) {
$installs = array_merge($installs, drupal_system_listing('/'. $module . '.install$/', 'modules'));
$installs = array_merge($installs, drupal_system_listing('/' . $module . '.install$/', 'modules'));
}
return $installs;
}
......@@ -938,7 +938,7 @@ function drupal_check_profile($profile) {
$requirements = array();
foreach ($installs as $install) {
require_once DRUPAL_ROOT . '/' . $install->filepath;
$function = $install->name. '_requirements';
$function = $install->name . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
......
......@@ -542,7 +542,7 @@ function locale_translate_overview_screen() {
// Languages with at least one record in the locale table.
$translations = db_query("SELECT COUNT(*) AS translation, t.language, s.textgroup FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY textgroup, language");
foreach ($translations as $data) {
$ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup])*100., 2) : 0;
$ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup]) * 100.0, 2) : 0;
$rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)";
}
......
......@@ -1839,7 +1839,7 @@ function menu_router_build() {
// a given item came from.
$callbacks = array();
foreach (module_implements('menu') as $module) {
$router_items = call_user_func($module .'_menu');
$router_items = call_user_func($module . '_menu');
if (isset($router_items) && is_array($router_items)) {
foreach (array_keys($router_items) as $path) {
$router_items[$path]['module'] = $module;
......
......@@ -157,7 +157,7 @@ function module_rebuild_cache() {
* without this module.
*/
function _module_build_dependencies($files) {
require_once DRUPAL_ROOT .'/includes/graph.inc';
require_once DRUPAL_ROOT . '/includes/graph.inc';
$roots = $files;
foreach ($files as $filename => $file) {
$graph[$file->name]['edges'] = array();
......
......@@ -895,7 +895,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array();
// Escape the periods in the extension.
$regex = '/'. str_replace('.', '\.', $extension) . '$/';
$regex = '/' . str_replace('.', '\.', $extension) . '$/';
// Because drupal_system_listing works the way it does, we check for real
// templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0);
......
......@@ -665,7 +665,7 @@ function install_tasks($profile, $task) {
// to the same address, until the batch finished callback is invoked
// and the task advances to 'locale-initial-import'.
if ($task == 'profile-install-batch') {
include_once DRUPAL_ROOT .'/includes/batch.inc';
include_once DRUPAL_ROOT . '/includes/batch.inc';
$output = _batch_page();
}
......@@ -917,7 +917,7 @@ function install_check_requirements($profile, $verify) {
'title' => st('Settings file'),
'value' => st('The settings file does not exist.'),
'severity' => REQUIREMENT_ERROR,
'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path .'/default.settings.php', '@install_txt' => base_path() .'INSTALL.txt')),
'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@install_txt' => base_path() . 'INSTALL.txt')),
);
}
else {
......
......@@ -242,7 +242,7 @@ EOF;
function createSampleNodes() {
// Post 5 articles.
for($i = 0; $i < 5; $i++) {
for ($i = 0; $i < 5; $i++) {
$edit = array();
$edit['title'] = $this->randomName();
$edit['body'] = $this->randomName();
......
......@@ -36,9 +36,9 @@ class BlogTestCase extends DrupalWebTestCase {
$this->drupalLogin($this->big_user);
$this->drupalGet('blog/'. $this->big_user->uid);
$this->drupalGet('blog/' . $this->big_user->uid);
$this->assertResponse(200);
$this->assertTitle(t("@name's blog", array('@name' => $this->big_user->name)) .' | Drupal', t('Blog title was displayed'));
$this->assertTitle(t("@name's blog", array('@name' => $this->big_user->name)) . ' | Drupal', t('Blog title was displayed'));
$this->assertText(t('You are not allowed to post a new blog entry.'), t('No new entries can be posted without the right permission'));
}
......@@ -48,9 +48,9 @@ class BlogTestCase extends DrupalWebTestCase {
function testBlogPageNoEntries() {
$this->drupalLogin($this->big_user);
$this->drupalGet('blog/'. $this->own_user->uid);
$this->drupalGet('blog/' . $this->own_user->uid);
$this->assertResponse(200);
$this->assertTitle(t("@name's blog", array('@name' => $this->own_user->name)) .' | Drupal', t('Blog title was displayed'));
$this->assertTitle(t("@name's blog", array('@name' => $this->own_user->name)) . ' | Drupal', t('Blog title was displayed'));
$this->assertText(t('!author has not created any blog entries.', array('!author' => $this->own_user->name)), t('Users blog displayed with no entries'));
}
......@@ -139,14 +139,14 @@ class BlogTestCase extends DrupalWebTestCase {
// View blog node.
$this->drupalGet('node/' . $node->nid);
$this->assertResponse(200);
$this->assertTitle($node->title. ' | Drupal', t('Blog node was displayed'));
$this->assertTitle($node->title . ' | Drupal', t('Blog node was displayed'));
$this->assertText(t('Home ' . $crumb . ' Blogs ' . $crumb . ' @name' . $quote . 's blog', array('@name' => $node_user->name)), t('Breadcrumbs were displayed'));
// View blog edit node.
$this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response);
if ($response == 200) {
$this->assertTitle('Edit Blog entry ' . $node->title. ' | Drupal', t('Blog edit node was displayed'));
$this->assertTitle('Edit Blog entry ' . $node->title . ' | Drupal', t('Blog edit node was displayed'));
$this->assertText(t('Home ' . $crumb . ' @title', array('@title' => $node->title)), t('Breadcrumbs were displayed'));
}
......
......@@ -331,7 +331,7 @@ function blogapi_status_error_check($node, $original_status) {
$node = (object) $node;
$node_type_default = variable_get('node_options_'. $node->type, array('status', 'promote'));
$node_type_default = variable_get('node_options_' . $node->type, array('status', 'promote'));
// If we don't have the 'administer nodes' permission and the status is
// changing or for a new node the status is not the content type's default,
......@@ -584,7 +584,7 @@ function blogapi_mt_validate_terms($node) {
$term_list = array_unique($node->taxonomy);
$params = $term_list;
$params[] = $node->type;
$result = db_query(db_rewrite_sql("SELECT t.tid, t.vid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_vocabulary_node_type} n ON t.vid = n.vid WHERE t.tid IN (". db_placeholders($term_list) .") AND n.type = '%s'", 't', 'tid'), $params);
$result = db_query(db_rewrite_sql("SELECT t.tid, t.vid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_vocabulary_node_type} n ON t.vid = n.vid WHERE t.tid IN (" . db_placeholders($term_list) . ") AND n.type = '%s'", 't', 'tid'), $params);
$found_terms = array();
$found_count = 0;
while ($term = db_fetch_object($result)) {
......@@ -768,7 +768,7 @@ function blogapi_admin_settings() {
'#field_suffix' => t('MB')
);
$form['settings_general']['upload_max_size'] = array('#value' => '<p>'. t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))).'</p>');
$form['settings_general']['upload_max_size'] = array('#value' => '<p>' . t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) . '</p>');
$roles = user_roles(FALSE, 'administer content with blog api');
$form['roles'] = array('#type' => 'value', '#value' => $roles);
......
......@@ -873,7 +873,7 @@ function comment_save($edit) {
$parent->thread = (string) rtrim((string) $parent->thread, '/');
// Get the max value in *this* thread.
$max = db_query("SELECT MAX(thread) FROM {comment} WHERE thread LIKE :thread AND nid = :nid", array(
':thread' => $parent->thread .'.%',
':thread' => $parent->thread . '.%',
':nid' => $edit['nid'],
))->fetchField();
......
......@@ -15,7 +15,7 @@
*/
function comment_edit($cid) {
global $user;
$comment = db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comment} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = :cid', array(':cid'=>$cid))->fetchObject();
$comment = db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comment} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = :cid', array(':cid' => $cid))->fetchObject();
$comment = drupal_unpack($comment);
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
......
......@@ -143,7 +143,7 @@ class CommentHelperCase extends DrupalWebTestCase {
* Comments per page value.
*/
function setCommentsPerPage($number) {
$this->setCommentSettings('comment_default_per_page_article', $number, 'Number of comments per page set to ' . $number .'.');
$this->setCommentSettings('comment_default_per_page_article', $number, 'Number of comments per page set to ' . $number . '.');
}
/**
......@@ -280,7 +280,7 @@ class CommentInterfaceTest extends CommentHelperCase {
$reply_loaded = comment_load($reply->id);
$this->assertTrue($this->commentExists($reply, TRUE), t('Reply found.'));
$this->assertEqual($comment->id, $reply_loaded->pid, t('Pid of a reply to a comment is set correctly.'));
$this->assertEqual(rtrim($comment_loaded->thread,'/').'.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
$this->assertEqual(rtrim($comment_loaded->thread, '/') . '.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
// Second reply to comment
$this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
......@@ -289,7 +289,7 @@ class CommentInterfaceTest extends CommentHelperCase {
$reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
$reply_loaded = comment_load($reply->id);
$this->assertTrue($this->commentExists($reply, TRUE), t('Second reply found.'));
$this->assertEqual(rtrim($comment_loaded->thread,'/').'.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
$this->assertEqual(rtrim($comment_loaded->thread, '/') . '.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
// Edit reply.
$this->drupalGet('comment/edit/' . $reply->id);
......@@ -524,11 +524,11 @@ class CommentApprovalTest extends CommentHelperCase {
// Approve comment.
$this->drupalLogin($this->admin_user);
$this->drupalGet('node/'. $this->node->nid);
$this->drupalGet('node/' . $this->node->nid);
$this->clickLink(t('approve'));
$this->drupalLogout();
$this->drupalGet('node/'. $this->node->nid);
$this->drupalGet('node/' . $this->node->nid);
$this->assertTrue($this->commentExists($anonymous_comment4), t('Anonymous comment visible.'));
}
}
......
......@@ -185,7 +185,7 @@ class ContactSitewideTestCase extends DrupalWebTestCase {
$edit['reply'] = $reply;
$edit['selected'] = ($selected ? '1' : '0');
$this->drupalPost('admin/build/contact/edit/' . $category_id, $edit, t('Save'));
return($category_id);
return ($category_id);
}
/**
......
......@@ -197,7 +197,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->drupalLogout();
// Fetch row ids in watchdog that relate to the user.
$result = db_query('SELECT wid FROM {watchdog} WHERE uid = :uid', array(':uid' => $user->uid));
foreach($result as $row) {
foreach ($result as $row) {
$ids[] = $row->wid;
}
$count_before = (isset($ids)) ? count($ids) : 0;
......@@ -225,7 +225,7 @@ class DBLogTestCase extends DrupalWebTestCase {
unset($ids);
// Fetch row ids in watchdog that relate to the user.
$result = db_query('SELECT wid FROM {watchdog} WHERE uid = :uid', array(':uid' => $user->uid));
foreach($result as $row) {
foreach ($result as $row) {
$ids[] = $row->wid;
}
$this->assertTrue(!isset($ids), t('DBLog contains no records for @name', array('@name' => $user->name)));
......
......@@ -15,7 +15,7 @@ function field_default_form($obj_type, $object, $field, $instance, $items, &$for
// This could be called with no object, as when a UI module creates a
// dummy form to set default values.
if ($object) {
list($id, ,) = field_attach_extract_ids($obj_type, $object);
list($id, , ) = field_attach_extract_ids($obj_type, $object);
}
$addition = array();
......
......@@ -101,7 +101,7 @@ function field_help($path, $arg) {
switch ($path) {
case 'admin/help#field':
$output = '<p>' . t('The Field API allows custom data fields to be attached to Drupal objects and takes care of storing, loading, editing, and rendering field data. Any object type (node, user, etc.) can use the Field API to make itself "fieldable" and thus allow fields to be attached to it.') . '</p>';
$output .= '<p>' .t('The Field API provides no user interface on its own. Use the Content Construction Kit (CCK) contrib module to manage custom fields via a web browser.') . '</p>';
$output .= '<p>' . t('The Field API provides no user interface on its own. Use the Content Construction Kit (CCK) contrib module to manage custom fields via a web browser.') . '</p>';
return $output;
}
}
......
......@@ -1039,7 +1039,7 @@ class FieldFormTestCase extends DrupalWebTestCase {
$this->assertPattern("|$pattern|s", 'Widgets are displayed in the correct order');
$this->assertFieldByName("$this->field_name[$delta][value]", '', "New widget is displayed");
$this->assertFieldByName("$this->field_name[$delta][_weight]", $delta, "New widget has the right weight");
$this->assertNoField("$this->field_name[". ($delta + 1) . '][value]', 'No extraneous widget is displayed');
$this->assertNoField("$this->field_name[" . ($delta + 1) . '][value]', 'No extraneous widget is displayed');
}
/**
......
......@@ -310,7 +310,7 @@ function filter_formats($index = NULL) {
if (!$all) {
$or = db_or()->condition('format', variable_get('filter_default_format', 1));
foreach ($user->roles as $rid => $role) {
$or->condition('roles', '%'. (int)$rid .'%', 'LIKE');
$or->condition('roles', '%' . (int)$rid . '%', 'LIKE');
}
$query->condition($or);
}
......
......@@ -101,7 +101,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user);
$this->drupalGet('node/add/page');
$this->assertRaw('<option value="' . $full .'">Full HTML</option>', t('Full HTML filter accessible.'));
$this->assertRaw('<option value="' . $full . '">Full HTML</option>', t('Full HTML filter accessible.'));
// Use filtered HTML and see if it removes tags that arn't allowed.
$body = $this->randomName();
......
......@@ -193,11 +193,11 @@ class ForumTestCase extends DrupalWebTestCase {
*/
function deleteForum($tid) {
// Delete the forum id.
$this->drupalPost('admin/build/forum/edit/forum/'. $tid, array(), t('Delete'));
$this->drupalPost('admin/build/forum/edit/forum/' . $tid, array(), t('Delete'));
$this->drupalPost(NULL, NULL, t('Delete'));
// Assert that the forum no longer exists.
$this->drupalGet('forum/'. $tid);
$this->drupalGet('forum/' . $tid);
$this->assertRaw(t('No forums defined'), 'The forum was not found');
}
......
......@@ -341,7 +341,7 @@ function menu_node_update($node) {
*/
function menu_node_delete($node) {
// Delete all menu module links that point to this node.
$result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/'. $node->nid), array('fetch' => PDO::FETCH_ASSOC));
$result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/' . $node->nid), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $m) {
menu_link_delete($m['mlid']);
}
......@@ -358,14 +358,14 @@ function menu_node_prepare($node) {
if (isset($node->nid)) {
// Give priority to the default menu
$mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", array(
':path' => 'node/'. $node->nid,
':path' => 'node/' . $node->nid,
':menu_name' => $menu_name,
), 0, 1)
->fetchField();
// Check all menus if a link does not exist in the default menu.
if (!$mlid) {
$mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' ORDER BY mlid ASC", array(
':path' => 'node/'. $node->nid,
':path' => 'node/' . $node->nid,
), 0, 1)
->fetchField();
}
......
......@@ -100,7 +100,7 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/build/menu/add');
$menu_name = substr(md5($this->randomName(16)), 0, MENU_MAX_MENU_NAME_LENGTH_UI + 1);
$title = $this->randomName(16);
$edit = array (
$edit = array(
'menu_name' => $menu_name,
'description' => '',
'title' => $title,
......@@ -181,7 +181,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Note in the UI the 'mlid:x[hidden]' form element maps to enabled, or
// NOT hidden.
$edit['mlid:' . $item1['mlid'] . '[hidden]'] = TRUE;
$this->drupalPost('admin/build/menu-customize/'. $item1['menu_name'], $edit, t('Save configuration'));
$this->drupalPost('admin/build/menu-customize/' . $item1['menu_name'], $edit, t('Save configuration'));
// Verify in the database.
$hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $item1['mlid']))->fetchField();
......@@ -206,7 +206,7 @@ class MenuTestCase extends DrupalWebTestCase {
$this->assertResponse(200);
$title = '!link_' . $this->randomName(16);
$edit = array (
$edit = array(
'menu[link_path]' => $link,
'menu[link_title]' => $title,
'menu[description]' => '',
......@@ -250,7 +250,7 @@ class MenuTestCase extends DrupalWebTestCase {
*/
function addInvalidMenuLink($menu_name = 'navigation') {
foreach (array('-&-', 'admin/user/permissions') as $link_path) {
$edit = array (
$edit = array(
'menu[link_path]' => $link_path,
'menu[link_title]' => 'title',
);
......
......@@ -52,7 +52,7 @@ function theme_node_admin_overview($name, $type) {
* Generates the node type editing form.
*/
function node_type_form(&$form_state, $type = NULL) {
drupal_add_js(drupal_get_path('module', 'node') .'/content_types.js');
drupal_add_js(drupal_get_path('module', 'node') . '/content_types.js');
if (!isset($type->type)) {
// This is a new type. Node module managed types are custom and unlocked.
$type = node_type_set_defaults(array('custom' => 1, 'locked' => 0));
......@@ -167,7 +167,7 @@ function node_type_form(&$form_state, $type = NULL) {
$form['display']['node_submitted'] = array(
'#type' => 'checkbox',
'#title' => t('Display post information'),
'#default_value' => variable_get('node_submitted_'. $type->type, TRUE),
'#default_value' => variable_get('node_submitted_' . $type->type, TRUE),
'#description' => t('Enable the <em>submitted by Username on date</em> text.'),
);
$form['old_type'] = array(
......
......@@ -481,7 +481,7 @@ function node_admin_nodes() {
$filter = node_build_filter_query();
$sort = tablesort_sql($header, '', 'n.changed DESC');
$result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] . $sort), 50, 0, NULL, $filter['args']);
$result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n ' . $filter['join'] . ' INNER JOIN {users} u ON n.uid = u.uid ' . $filter['where'] . $sort), 50, 0, NULL, $filter['args']);
// Build the 'Update options' form.
$form['options'] = array(
......
......@@ -1458,14 +1458,14 @@ function _node_rankings() {
);
if ($ranking = module_invoke_all('ranking')) {
foreach ($ranking as $rank => $values) {
if ($node_rank = variable_get('node_rank_'. $rank, 0)) {
if ($node_rank = variable_get('node_rank_' . $rank, 0)) {
// If the table defined in the ranking isn't already joined, then add it.
if (isset($values['join']) && !isset($rankings['join'][$values['join']])) {
$rankings['join'][$values['join']] = $values['join'];
}
// Add the rankings weighted score multiplier value, handling NULL gracefully.
$rankings['score'][] = 'CAST(%f AS DECIMAL) * COALESCE(('. $values['score'] .'), 0)';
$rankings['score'][] = 'CAST(%f AS DECIMAL) * COALESCE((' . $values['score'] . '), 0)';
// Add the the administrator's weighted score multiplier value for this ranking.
$rankings['total'] += $node_rank;
......@@ -1517,11 +1517,11 @@ function node_search($op = 'search', $keys = NULL) {
// Note: reversed to reflect that higher number = higher ranking.
$options = drupal_map_assoc(range(0, 10));
foreach (module_invoke_all('ranking') as $var => $values) {
$form['content_ranking']['factors']['node_rank_'. $var] = array(
$form['content_ranking']['factors']['node_rank_' . $var] = array(
'#title' => $values['title'],
'#type' => 'select',
'#options' => $options,
'#default_value' => variable_get('node_rank_'. $var, 0),
'#default_value' => variable_get('node_rank_' . $var, 0),
);
}
return $form;
......@@ -1578,7 +1578,7 @@ function node_search($op = 'search', $keys = NULL) {
$total = $rankings['total'];
$arguments2 = $rankings['arguments'];
$join2 = implode(' ', $rankings['join']);
$select2 = 'SUM('. implode(' + ', $rankings['score']) .') AS calculated_score';
$select2 = 'SUM(' . implode(' + ', $rankings['score']) . ') AS calculated_score';
}
// Do search.
......@@ -2175,7 +2175,7 @@ function node_update_index() {
$result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
foreach($result as $node) {
foreach ($result as $node) {
_node_index_node($node);
}
}
......
......@@ -94,7 +94,7 @@ function openid_user_delete_form($form_state, $account, $aid = 0) {
':aid' => $aid,
))
->fetchField();
return confirm_form(array(), t('Are you sure you want to delete the OpenID %authname for %user?', array('%authname' => $authname, '%user' => $account->name)), 'user/'. $account->uid .'/openid');
return confirm_form(array(), t('Are you sure you want to delete the OpenID %authname for %user?', array('%authname' => $authname, '%user' => $account->name)), 'user/' . $account->uid . '/openid');
}
function openid_user_delete_form_submit(&$form_state, $form_values) {
......@@ -106,5 +106,5 @@ function openid_user_delete_form_submit(&$form_state, $form_values) {
if ($query) {
drupal_set_message(t('OpenID deleted.'));
}
$form_state['#redirect'] = 'user/'. $form_state['#args'][0]->uid .'/openid';
$form_state['#redirect'] = 'user/' . $form_state['#args'][0]->uid . '/openid';
}
......@@ -55,7 +55,7 @@ class PHPFilterTestCase extends PHPTestCase {
$node = $this->createNodeWithCode();
// Make sure that the PHP code shows up as text.
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertText('print', t('PHP code is displayed.'));
// Change filter to PHP filter and see that PHP code is evaluated.
......@@ -92,7 +92,7 @@ class PHPAccessTestCase extends PHPTestCase {
$node = $this->createNodeWithCode();
// Make sure that the PHP code shows up as text.
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertText('print', t('PHP code is displayed.'));
// Make sure that user doesn't have access to filter.
......
......@@ -397,7 +397,7 @@ function profile_field_delete_submit($form, &$form_state) {
*/
function profile_admin_settings_autocomplete($string) {
$matches = array();
$result = db_query_range("SELECT category FROM {profile_field} WHERE LOWER(category) LIKE LOWER(:category)", array(':category' => $string .'%'), 0, 10);
$result = db_query_range("SELECT category FROM {profile_field} WHERE LOWER(category) LIKE LOWER(:category)", array(':category' => $string . '%'), 0, 10);
while ($data = db_fetch_object($result)) {
$matches[$data->category] = check_plain($data->category);
}
......
......@@ -114,7 +114,7 @@ function profile_autocomplete($field, $string) {
if ($autocomplete_field) {
$result = db_query_range("SELECT value FROM {profile_value} WHERE fid = :fid AND LOWER(value) LIKE LOWER(:value) GROUP BY value ORDER BY value ASC", array(
':fid' => $field,
':value' => $string .'%',
':value' => $string . '%',
), 0, 10);
while ($data = db_fetch_object($result)) {
$matches[$data->value] = check_plain($data->value);
......
......@@ -136,7 +136,7 @@ class ProfileTestFields extends ProfileTestCase {
'checkbox' => 1,
// An underscore is an invalid character in a domain name. The method randomName can
// return an underscore.
'url' => 'http://www.' . str_replace('_', '', $this->randomName(10)). '.org',
'url' => 'http://www.' . str_replace('_', '', $this->randomName(10)) . '.org',
);
// For each field type, create a field, give it a value and delete the field.
......@@ -263,7 +263,7 @@ class ProfileTestAutocomplete extends ProfileTestCase {
// Set some html for what we want to see in the page output later.
$autocomplete_html = '<input class="autocomplete" type="hidden" id="' . form_clean_id('edit-' . $field['form_name'] . '-autocomplete') . '" value="' . url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE)) . '" disabled="disabled" />';
$field_html = '<input type="text" maxlength="255" name="' . $field['form_name'] . '" id="'. form_clean_id('edit-' . $field['form_name']) . '" size="60" value="' . $field['value'] . '" class="form-text form-autocomplete required" />';
$field_html = '<input type="text" maxlength="255" name="' . $field['form_name'] . '" id="' . form_clean_id('edit-' . $field['form_name']) . '" size="60" value="' . $field['value'] . '" class="form-text form-autocomplete required" />';
// Check that autocompletion html is found on the user's profile edit page.
$this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category);
......
......@@ -52,34 +52,34 @@
* Matches all 'N' Unicode character classes (numbers)
*/
define('PREG_CLASS_NUMBERS',
'\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}\x{660}-\x{669}\x{6f0}-\x{6f9}'.
'\x{966}-\x{96f}\x{9e6}-\x{9ef}\x{9f4}-\x{9f9}\x{a66}-\x{a6f}\x{ae6}-\x{aef}'.
'\x{b66}-\x{b6f}\x{be7}-\x{bf2}\x{c66}-\x{c6f}\x{ce6}-\x{cef}\x{d66}-\x{d6f}'.
'\x{e50}-\x{e59}\x{ed0}-\x{ed9}\x{f20}-\x{f33}\x{1040}-\x{1049}\x{1369}-'.
'\x{137c}\x{16ee}-\x{16f0}\x{17e0}-\x{17e9}\x{17f0}-\x{17f9}\x{1810}-\x{1819}'.
'\x{1946}-\x{194f}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2153}-\x{2183}'.
'\x{2460}-\x{249b}\x{24ea}-\x{24ff}\x{2776}-\x{2793}\x{3007}\x{3021}-\x{3029}'.
'\x{3038}-\x{303a}\x{3192}-\x{3195}\x{3220}-\x{3229}\x{3251}-\x{325f}\x{3280}-'.
'\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}\x{660}-\x{669}\x{6f0}-\x{6f9}' .
'\x{966}-\x{96f}\x{9e6}-\x{9ef}\x{9f4}-\x{9f9}\x{a66}-\x{a6f}\x{ae6}-\x{aef}' .
'\x{b66}-\x{b6f}\x{be7}-\x{bf2}\x{c66}-\x{c6f}\x{ce6}-\x{cef}\x{d66}-\x{d6f}' .
'\x{e50}-\x{e59}\x{ed0}-\x{ed9}\x{f20}-\x{f33}\x{1040}-\x{1049}\x{1369}-' .
'\x{137c}\x{16ee}-\x{16f0}\x{17e0}-\x{17e9}\x{17f0}-\x{17f9}\x{1810}-\x{1819}' .
'\x{1946}-\x{194f}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2153}-\x{2183}' .
'\x{2460}-\x{249b}\x{24ea}-\x{24ff}\x{2776}-\x{2793}\x{3007}\x{3021}-\x{3029}' .
'\x{3038}-\x{303a}\x{3192}-\x{3195}\x{3220}-\x{3229}\x{3251}-\x{325f}\x{3280}-' .
'\x{3289}\x{32b1}-\x{32bf}\x{ff10}-\x{ff19}');
/**
* Matches all 'P' Unicode character classes (punctuation)
*/
define('PREG_CLASS_PUNCTUATION',
'\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}'.
'\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{55a}-\x{55f}'.
'\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{60c}\x{60d}\x{61b}\x{61f}'.
'\x{66a}-\x{66d}\x{6d4}\x{700}-\x{70d}\x{964}\x{965}\x{970}\x{df4}\x{e4f}'.
'\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}'.
'\x{1361}-\x{1368}\x{166d}\x{166e}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}'.
'\x{1736}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{1944}\x{1945}'.
'\x{2010}-\x{2027}\x{2030}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}'.
'\x{207d}\x{207e}\x{208d}\x{208e}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-'.
'\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}'.
'\x{3001}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}'.
'\x{30fb}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}'.
'\x{fe6a}\x{fe6b}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}'.
'\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-'.
'\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}' .
'\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{55a}-\x{55f}' .
'\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{60c}\x{60d}\x{61b}\x{61f}' .
'\x{66a}-\x{66d}\x{6d4}\x{700}-\x{70d}\x{964}\x{965}\x{970}\x{df4}\x{e4f}' .
'\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}' .
'\x{1361}-\x{1368}\x{166d}\x{166e}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}' .
'\x{1736}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{1944}\x{1945}' .
'\x{2010}-\x{2027}\x{2030}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}' .
'\x{207d}\x{207e}\x{208d}\x{208e}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-' .
'\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}' .
'\x{3001}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}' .
'\x{30fb}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}' .
'\x{fe6a}\x{fe6b}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}' .
'\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-' .
'\x{ff65}');
/**
......