Skip to content

Drupal 6.26 #43

Merged
merged 21 commits into from May 2, 2012
Select commit
+81 −50
View
4 CHANGELOG.txt
@@ -1,3 +1,7 @@
+Drupal 6.26, 2012-05-02
+----------------------
+- Fixed a small number of bugs.
+- Made code documentation improvements.
Drupal 6.25, 2012-02-29
----------------------
View
4 includes/cache.inc
@@ -9,6 +9,8 @@
* @param $table
* The table $table to store the data in. Valid core values are 'cache_filter',
* 'cache_menu', 'cache_page', or 'cache' for the default cache.
+ *
+ * @see cache_set()
*/
function cache_get($cid, $table = 'cache') {
global $user;
@@ -97,6 +99,8 @@ function cache_get($cid, $table = 'cache') {
* the given time, after which it behaves like CACHE_TEMPORARY.
* @param $headers
* A string containing HTTP header information for cached pages.
+ *
+ * @see cache_get()
*/
function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {
$serialized = 0;
View
15 includes/common.inc
@@ -291,7 +291,8 @@ function drupal_get_destination() {
* @param $path
* A Drupal path or a full URL.
* @param $query
- * A query string component, if any.
+ * A URL-encoded query string to append to the link, or an array of query
+ * key/value-pairs without any URL-encoding. Passed to url().
* @param $fragment
* A destination fragment identifier (named anchor).
* @param $http_response_code
@@ -572,8 +573,10 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
}
fclose($fp);
- // Parse response.
- list($split, $result->data) = explode("\r\n\r\n", $response, 2);
+ // Parse response headers from the response body.
+ // Be tolerant of malformed HTTP responses that separate header and body with
+ // \n\n or \r\r instead of \r\n\r\n. See http://drupal.org/node/183435
+ list($split, $result->data) = preg_split("/\r\n\r\n|\n\n|\r\r/", $response, 2);
$split = preg_split("/\r\n|\n|\r/", $split);
list($protocol, $code, $status_message) = explode(' ', trim(array_shift($split)), 3);
@@ -653,7 +656,7 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
return;
}
- if ($errno & (E_ALL ^ E_DEPRECATED)) {
+ if ($errno & (E_ALL ^ E_DEPRECATED ^ E_NOTICE)) {
$types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error');
// For database errors, we want the line number/file name of the place that
@@ -2539,8 +2542,8 @@ function drupal_to_js($var) {
* (optional) If set, the variable will be converted to JSON and output.
*/
function drupal_json($var = NULL) {
- // We are returning JavaScript, so tell the browser.
- drupal_set_header('Content-Type: text/javascript; charset=utf-8');
+ // We are returning JSON, so tell the browser.
+ drupal_set_header('Content-Type: application/json');
if (isset($var)) {
echo drupal_to_js($var);
View
5 includes/database.mysql-common.inc
@@ -26,8 +26,9 @@
* and TRUE values to decimal 1.
*
* @return
- * A database query result resource, or FALSE if the query was not
- * executed correctly.
+ * Successful SELECT, SHOW, DESCRIBE, EXPLAIN, or other queries which return a
+ * set of results will return a database query result resource. Other
+ * successful queries will return TRUE and failing queries will return FALSE.
*/
function db_query($query) {
$args = func_get_args();
View
10 includes/database.mysql.inc
@@ -211,7 +211,7 @@ function db_fetch_array($result) {
*
* @param $result
* A database query result resource, as returned from db_query().
- *
+ *
* @return
* The resulting field or FALSE.
*/
@@ -334,9 +334,9 @@ function db_query_range_slave($query) {
/**
* Runs a SELECT query and stores its results in a temporary table.
*
- * Use this as a substitute for db_query() when the results need to stored
- * in a temporary table. Temporary tables exist for the duration of the page
- * request.
+ * Use this as a substitute for db_query() when the results need to be stored
+ * in a temporary table.
+ *
* User-supplied arguments to the query should be passed in as separate parameters
* so that they can be properly escaped to avoid SQL injection attacks.
*
@@ -355,10 +355,10 @@ function db_query_range_slave($query) {
*
* NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
* and TRUE values to decimal 1.
- *
* @param $table
* The name of the temporary table to select into. This name will not be
* prefixed as there is no risk of collision.
+ *
* @return
* A database query result resource, or FALSE if the query was not executed
* correctly.
View
8 includes/database.mysqli.inc
@@ -334,9 +334,9 @@ function db_query_range_slave($query) {
/**
* Runs a SELECT query and stores its results in a temporary table.
*
- * Use this as a substitute for db_query() when the results need to stored
- * in a temporary table. Temporary tables exist for the duration of the page
- * request.
+ * Use this as a substitute for db_query() when the results need to be stored
+ * in a temporary table.
+ *
* User-supplied arguments to the query should be passed in as separate parameters
* so that they can be properly escaped to avoid SQL injection attacks.
*
@@ -355,10 +355,10 @@ function db_query_range_slave($query) {
*
* NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
* and TRUE values to decimal 1.
- *
* @param $table
* The name of the temporary table to select into. This name will not be
* prefixed as there is no risk of collision.
+ *
* @return
* A database query result resource, or FALSE if the query was not executed
* correctly.
View
8 includes/database.pgsql.inc
@@ -345,9 +345,9 @@ function db_query_range_slave($query) {
/**
* Runs a SELECT query and stores its results in a temporary table.
*
- * Use this as a substitute for db_query() when the results need to stored
- * in a temporary table. Temporary tables exist for the duration of the page
- * request.
+ * Use this as a substitute for db_query() when the results need to be stored
+ * in a temporary table.
+ *
* User-supplied arguments to the query should be passed in as separate parameters
* so that they can be properly escaped to avoid SQL injection attacks.
*
@@ -366,10 +366,10 @@ function db_query_range_slave($query) {
*
* NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
* and TRUE values to decimal 1.
- *
* @param $table
* The name of the temporary table to select into. This name will not be
* prefixed as there is no risk of collision.
+ *
* @return
* A database query result resource, or FALSE if the query was not executed
* correctly.
View
9 includes/form.inc
@@ -305,6 +305,11 @@ function drupal_execute($form_id, &$form_state) {
$form = call_user_func_array('drupal_retrieve_form', $args);
$form['#post'] = $form_state['values'];
+
+ // Reset form validation.
+ $form_state['must_validate'] = TRUE;
+ form_set_error(NULL, '', TRUE);
+
drupal_prepare_form($form_id, $form, $form_state);
drupal_process_form($form_id, $form, $form_state);
}
@@ -575,7 +580,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
function drupal_validate_form($form_id, $form, &$form_state) {
static $validated_forms = array();
- if (isset($validated_forms[$form_id])) {
+ if (isset($validated_forms[$form_id]) && empty($form_state['must_validate'])) {
return;
}
@@ -2437,7 +2442,7 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* clean code independence, ensuring that several batches submitted by
* different parts of the code (core / contrib modules) can be processed
* correctly while not interfering or having to cope with each other. Each
- * batch set gets to specify his own UI messages, operates on its own set
+ * batch set gets to specify its own UI messages, operates on its own set
* of operations and results, and triggers its own 'finished' callback.
* Batch sets are processed sequentially, with the progress bar starting
* fresh for every new set.
View
5 includes/locale.inc
@@ -1293,14 +1293,11 @@ function _locale_import_one_string($op, $value = NULL, $mode = NULL, $lang = NUL
// data untouched or if we don't have an existing plural formula.
$header = _locale_import_parse_header($value['msgstr']);
- // Get the plural formula and update in database.
+ // Get and store the plural formula if available.
if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) {
list($nplurals, $plural) = $p;
db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
}
- else {
- db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", 0, '', $lang);
- }
}
$headerdone = TRUE;
}
View
18 includes/theme.inc
@@ -1191,12 +1191,24 @@ function theme_status_messages($display = NULL) {
}
/**
- * Return a themed set of links.
+ * Returns HTML for a set of links.
*
* @param $links
- * A keyed array of links to be themed.
+ * An associative array of links to be themed. The key for each link
+ * is used as its CSS class. Each link should be itself an array, with the
+ * following elements:
+ * - title: The link text.
+ * - href: The link URL. If omitted, the 'title' is shown as a plain text
+ * item in the links list.
+ * - html: (optional) Whether or not 'title' is HTML. If set, the title
+ * will not be passed through check_plain().
+ * - attributes: (optional) Attributes for the anchor, or for the <span> tag
+ * used in its place if no 'href' is supplied.
+ * If the 'href' element is supplied, the entire link array is passed to l()
+ * as its $options parameter.
* @param $attributes
- * A keyed array of attributes
+ * An associative array of attributes for the UL containing the list of links.
+ *
* @return
* A string containing an unordered list of links.
*/
View
2 misc/tabledrag.js
@@ -1014,7 +1014,7 @@ Drupal.tableDrag.prototype.row.prototype.findSiblings = function(rowSettings) {
var siblings = new Array();
var directions = new Array('prev', 'next');
var rowIndentation = this.indents;
- for (var d in directions) {
+ for (var d = 0; d < directions.length; d++) {
var checkRow = $(this.element)[directions[d]]();
while (checkRow.length) {
// Check that the sibling contains a similar target field.
View
2 modules/dblog/dblog.admin.inc
@@ -79,7 +79,7 @@ function dblog_overview() {
format_date($dblog->timestamp, 'small'),
l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/'. $dblog->wid, array('html' => TRUE)),
theme('username', $dblog),
- $dblog->link,
+ filter_xss($dblog->link),
),
// Attributes for tr
'class' => "dblog-". preg_replace('/[^a-z]/i', '-', $dblog->type) .' '. $classes[$dblog->severity]
View
6 modules/openid/openid.module
@@ -501,6 +501,8 @@ function openid_association_request($public) {
}
function openid_authentication_request($claimed_id, $identity, $return_to = '', $assoc_handle = '', $version = 2) {
+ global $base_url;
+
module_load_include('inc', 'openid');
$ns = ($version == 2) ? OPENID_NS_2_0 : OPENID_NS_1_0;
@@ -514,10 +516,10 @@ function openid_authentication_request($claimed_id, $identity, $return_to = '',
);
if ($version == 2) {
- $request['openid.realm'] = url('', array('absolute' => TRUE));
+ $request['openid.realm'] = $base_url . '/';
}
else {
- $request['openid.trust_root'] = url('', array('absolute' => TRUE));
+ $request['openid.trust_root'] = $base_url . '/';
}
// Simple Registration
View
2 modules/search/search.module
@@ -43,7 +43,7 @@ define('PREG_CLASS_SEARCH_EXCLUDE',
'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'.
'\x{3099}-\x{309e}\x{30a0}\x{30fb}\x{30fd}\x{30fe}\x{3190}-\x{319f}\x{31c0}-'.
'\x{31cf}\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}'.
-'\x{a806}\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}'.
+'\x{a806}\x{a80b}\x{a823}-\x{a82b}\x{e000}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}'.
'\x{fd3f}\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}'.
'\x{ff5b}-\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}');
View
2 modules/system/system.admin.inc
@@ -128,7 +128,7 @@ function system_admin_by_module() {
}
/**
- * Menu callback; displays a module's settings page.
+ * Menu callback: Displays the configuration overview page.
*/
function system_settings_overview() {
// Check database setup if necessary
View
2 modules/system/system.module
@@ -8,7 +8,7 @@
/**
* The current system version.
*/
-define('VERSION', '6.25');
+define('VERSION', '6.26');
/**
* Core API compatibility.
View
27 modules/user/user.module
@@ -2182,22 +2182,25 @@ function user_preferred_language($account, $default = NULL) {
* @see drupal_mail()
*
* @param $op
- * The operation being performed on the account. Possible values:
- * 'register_admin_created': Welcome message for user created by the admin
- * 'register_no_approval_required': Welcome message when user self-registers
- * 'register_pending_approval': Welcome message, user pending admin approval
- * 'password_reset': Password recovery request
- * 'status_activated': Account activated
- * 'status_blocked': Account blocked
- * 'status_deleted': Account deleted
+ * The operation being performed on the account. Possible values:
+ * - 'register_admin_created': Welcome message for user created by the admin.
+ * - 'register_no_approval_required': Welcome message when user
+ * self-registers.
+ * - 'register_pending_approval': Welcome message, user pending admin
+ * approval.
+ * - 'password_reset': Password recovery request.
+ * - 'status_activated': Account activated.
+ * - 'status_blocked': Account blocked.
+ * - 'status_deleted': Account deleted.
*
* @param $account
- * The user object of the account being notified. Must contain at
- * least the fields 'uid', 'name', and 'mail'.
+ * The user object of the account being notified. Must contain at
+ * least the fields 'uid', 'name', and 'mail'.
* @param $language
- * Optional language to use for the notification, overriding account language.
+ * Optional language to use for the notification, overriding account language.
+ *
* @return
- * The return value from drupal_mail_send(), if ends up being called.
+ * The return value from drupal_mail_send(), if ends up being called.
*/
function _user_mail_notify($op, $account, $language = NULL) {
// By default, we always notify except for deleted and blocked.
View
2 update.php
@@ -368,7 +368,7 @@ function update_info_page() {
update_task_list('info');
drupal_set_title('Drupal database update');
$token = drupal_get_token('update');
- $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>';
+ $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href="http://drupal.org/upgrade">upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>';
$output .= "<ol>\n";
$output .= "<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\n";
$output .= "<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\n";
Something went wrong with that request. Please try again.