summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/ajax.inc2
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/common.inc4
-rw-r--r--includes/entity.inc8
-rw-r--r--includes/file.inc2
-rw-r--r--includes/form.inc43
-rw-r--r--includes/module.inc6
7 files changed, 53 insertions, 14 deletions
diff --git a/includes/ajax.inc b/includes/ajax.inc
index 10877a246..6e8e277b8 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -211,7 +211,7 @@
*
* When returning an Ajax command array, it is often useful to have
* status messages rendered along with other tasks in the command array.
- * In that case the the Ajax commands array may be constructed like this:
+ * In that case the Ajax commands array may be constructed like this:
* @code
* $commands = array();
* $commands[] = ajax_command_replace(NULL, $output);
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index b33f950f4..b1dd6eb1f 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -8,7 +8,7 @@
/**
* The current system version.
*/
-define('VERSION', '7.35');
+define('VERSION', '7.36-dev');
/**
* Core API compatibility.
diff --git a/includes/common.inc b/includes/common.inc
index ad2a34541..0fac77201 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4470,8 +4470,8 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
*
* Libraries, JavaScript, CSS and other types of custom structures are attached
* to elements using the #attached property. The #attached property is an
- * associative array, where the keys are the the attachment types and the values
- * are the attached data. For example:
+ * associative array, where the keys are the attachment types and the values are
+ * the attached data. For example:
* @code
* $build['#attached'] = array(
* 'js' => array(drupal_get_path('module', 'taxonomy') . '/taxonomy.js'),
diff --git a/includes/entity.inc b/includes/entity.inc
index 203ed87f9..27434d048 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -28,7 +28,9 @@ interface DrupalEntityControllerInterface {
* @param $ids
* An array of entity IDs, or FALSE to load all entities.
* @param $conditions
- * An array of conditions in the form 'field' => $value.
+ * An array of conditions. Keys are field names on the entity's base table.
+ * Values will be compared for equality. All the comparisons will be ANDed
+ * together. This parameter is deprecated; use an EntityFieldQuery instead.
*
* @return
* An array of entity objects indexed by their ids. When no results are
@@ -236,7 +238,9 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
* @param $ids
* An array of entity IDs, or FALSE to load all entities.
* @param $conditions
- * An array of conditions in the form 'field' => $value.
+ * An array of conditions. Keys are field names on the entity's base table.
+ * Values will be compared for equality. All the comparisons will be ANDed
+ * together. This parameter is deprecated; use an EntityFieldQuery instead.
* @param $revision_id
* The ID of the revision to load, or FALSE if this query is asking for the
* most current revision(s).
diff --git a/includes/file.inc b/includes/file.inc
index 803661f4d..d3ac87ea0 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1559,7 +1559,7 @@ function file_save_upload($form_field_name, $validators = array(), $destination
return FALSE;
}
- // Add in our check of the the file name length.
+ // Add in our check of the file name length.
$validators['file_validate_name_length'] = array();
// Call the validation functions specified by this function's caller.
diff --git a/includes/form.inc b/includes/form.inc
index da1caa819..0d358c2b4 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -938,7 +938,7 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// after the batch is processed.
}
- // Set a flag to indicate the the form has been processed and executed.
+ // Set a flag to indicate that the form has been processed and executed.
$form_state['executed'] = TRUE;
// Redirect the form based on values in $form_state.
@@ -2451,6 +2451,17 @@ function form_type_password_confirm_value($element, $input = FALSE) {
$element += array('#default_value' => array());
return $element['#default_value'] + array('pass1' => '', 'pass2' => '');
}
+ $value = array('pass1' => '', 'pass2' => '');
+ // Throw out all invalid array keys; we only allow pass1 and pass2.
+ foreach ($value as $allowed_key => $default) {
+ // These should be strings, but allow other scalars since they might be
+ // valid input in programmatic form submissions. Any nested array values
+ // are ignored.
+ if (isset($input[$allowed_key]) && is_scalar($input[$allowed_key])) {
+ $value[$allowed_key] = (string) $input[$allowed_key];
+ }
+ }
+ return $value;
}
/**
@@ -2495,6 +2506,27 @@ function form_type_select_value($element, $input = FALSE) {
}
/**
+ * Determines the value for a textarea form element.
+ *
+ * @param array $element
+ * The form element whose value is being populated.
+ * @param mixed $input
+ * The incoming input to populate the form element. If this is FALSE,
+ * the element's default value should be returned.
+ *
+ * @return string
+ * The data that will appear in the $element_state['values'] collection
+ * for this element. Return nothing to use the default.
+ */
+function form_type_textarea_value($element, $input = FALSE) {
+ if ($input !== FALSE) {
+ // This should be a string, but allow other scalars since they might be
+ // valid input in programmatic form submissions.
+ return is_scalar($input) ? (string) $input : '';
+ }
+}
+
+/**
* Determines the value for a textfield form element.
*
* @param $element
@@ -2509,9 +2541,12 @@ function form_type_select_value($element, $input = FALSE) {
*/
function form_type_textfield_value($element, $input = FALSE) {
if ($input !== FALSE && $input !== NULL) {
- // Equate $input to the form value to ensure it's marked for
- // validation.
- return str_replace(array("\r", "\n"), '', $input);
+ // This should be a string, but allow other scalars since they might be
+ // valid input in programmatic form submissions.
+ if (!is_scalar($input)) {
+ $input = '';
+ }
+ return str_replace(array("\r", "\n"), '', (string) $input);
}
}
diff --git a/includes/module.inc b/includes/module.inc
index fe2a9805e..494924f53 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -265,11 +265,11 @@ function _module_build_dependencies($files) {
/**
* Determines whether a given module exists.
*
- * @param $module
+ * @param string $module
* The name of the module (without the .module extension).
*
- * @return
- * TRUE if the module is both installed and enabled.
+ * @return bool
+ * TRUE if the module is both installed and enabled, FALSE otherwise.
*/
function module_exists($module) {
$list = module_list();