Permalink
Browse files

Update to D7.22

  • Loading branch information...
1 parent badedd2 commit f123eb710760e6ba76a2230827383e14c5156e2e @holtzermann17 holtzermann17 committed May 12, 2013
Showing with 5,128 additions and 2,191 deletions.
  1. +18 −17 authorize.php
  2. +4 −3 includes/ajax.inc
  3. +34 −20 includes/bootstrap.inc
  4. +28 −41 includes/cache.inc
  5. +35 −5 includes/common.inc
  6. +36 −7 includes/database/database.inc
  7. +7 −2 includes/database/query.inc
  8. +3 −24 includes/database/sqlite/query.inc
  9. +5 −20 includes/file.inc
  10. +10 −0 includes/filetransfer/filetransfer.inc
  11. +1 −33 includes/form.inc
  12. +4 −4 includes/image.inc
  13. +32 −1 includes/install.core.inc
  14. +6 −0 includes/install.inc
  15. +138 −41 includes/language.inc
  16. +16 −12 includes/mail.inc
  17. +1 −0 includes/menu.inc
  18. +12 −5 includes/module.inc
  19. +1 −1 includes/password.inc
  20. +6 −6 includes/path.inc
  21. +1 −1 includes/session.inc
  22. +10 −6 includes/tablesort.inc
  23. +86 −67 includes/theme.inc
  24. +5 −5 includes/theme.maintenance.inc
  25. +10 −8 includes/token.inc
  26. +103 −32 includes/unicode.inc
  27. +6 −6 includes/update.inc
  28. +1 −0 includes/utility.inc
  29. +2 −2 install.php
  30. +1 −1 misc/ajax.js
  31. +1 −1 misc/machine-name.js
  32. +1 −1 misc/tableheader.js
  33. +3 −0 modules/aggregator/aggregator-rtl.css
  34. +8 −6 modules/aggregator/aggregator.admin.inc
  35. +3 −0 modules/aggregator/aggregator.css
  36. +3 −3 modules/aggregator/aggregator.info
  37. +5 −5 modules/aggregator/aggregator.module
  38. +44 −25 modules/aggregator/aggregator.pages.inc
  39. +6 −0 modules/aggregator/aggregator.processor.inc
  40. +84 −35 modules/aggregator/aggregator.test
  41. +3 −3 modules/aggregator/tests/aggregator_test.info
  42. +3 −3 modules/block/block.info
  43. +1 −1 modules/block/block.module
  44. +3 −3 modules/block/tests/block_test.info
  45. +3 −3 modules/block/tests/themes/block_test_theme/block_test_theme.info
  46. +3 −3 modules/blog/blog.info
  47. +4 −0 modules/book/book-rtl.css
  48. +11 −4 modules/book/book.admin.inc
  49. +4 −0 modules/book/book.css
  50. +3 −3 modules/book/book.info
  51. +0 −1 modules/book/book.js
  52. +31 −16 modules/book/book.module
  53. +12 −1 modules/book/book.pages.inc
  54. +76 −45 modules/book/book.test
  55. +3 −3 modules/color/color.info
  56. +2 −1 modules/comment/comment.admin.inc
  57. +3 −3 modules/comment/comment.info
  58. +16 −4 modules/comment/comment.module
  59. +3 −3 modules/contact/contact.info
  60. +3 −3 modules/contextual/contextual.info
  61. +3 −3 modules/dashboard/dashboard.info
  62. +4 −0 modules/dblog/dblog-rtl.css
  63. +57 −22 modules/dblog/dblog.admin.inc
  64. +5 −0 modules/dblog/dblog.css
  65. +3 −3 modules/dblog/dblog.info
  66. +17 −0 modules/dblog/dblog.install
  67. +12 −6 modules/dblog/dblog.module
  68. +136 −92 modules/dblog/dblog.test
  69. +6 −3 modules/field/field.api.php
  70. +61 −20 modules/field/field.attach.inc
  71. +18 −1 modules/field/field.crud.inc
  72. +4 −3 modules/field/field.info
  73. +668 −0 modules/field/field.info.class.inc
  74. +175 −274 modules/field/field.info.inc
  75. +7 −0 modules/field/field.install
  76. +3 −2 modules/field/field.module
  77. +3 −3 modules/field/modules/field_sql_storage/field_sql_storage.info
  78. +5 −2 modules/field/modules/field_sql_storage/field_sql_storage.module
  79. +3 −3 modules/field/modules/list/list.info
  80. +3 −3 modules/field/modules/list/tests/list_test.info
  81. +3 −3 modules/field/modules/number/number.info
  82. +3 −3 modules/field/modules/options/options.info
  83. +3 −3 modules/field/modules/text/text.info
  84. +326 −26 modules/field/tests/field.test
  85. +6 −0 modules/field/tests/field_test.entity.inc
  86. +3 −3 modules/field/tests/field_test.info
  87. +2 −2 modules/field_ui/field_ui.admin.inc
  88. +3 −3 modules/field_ui/field_ui.info
  89. +15 −8 modules/field_ui/field_ui.module
  90. +3 −3 modules/field_ui/field_ui.test
  91. +10 −2 modules/file/file.field.inc
  92. +3 −3 modules/file/file.info
  93. +3 −3 modules/file/tests/file_module_test.info
  94. +54 −11 modules/filter/filter.admin.inc
  95. +3 −3 modules/filter/filter.info
  96. +1 −1 modules/filter/filter.install
  97. +150 −75 modules/filter/filter.module
  98. +9 −5 modules/filter/filter.pages.inc
  99. +94 −24 modules/filter/filter.test
  100. +4 −0 modules/forum/forum-rtl.css
  101. +1 −1 modules/forum/forum.css
  102. +3 −3 modules/forum/forum.info
  103. +6 −1 modules/forum/forum.module
  104. +1 −0 modules/forum/forum.test
  105. +3 −3 modules/help/help.info
  106. +1 −1 modules/image/image.admin.inc
  107. +3 −3 modules/image/image.info
  108. +2 −1 modules/image/image.install
  109. +68 −39 modules/image/image.module
  110. +68 −2 modules/image/image.test
  111. +3 −3 modules/image/tests/image_module_test.info
  112. +2 −2 modules/locale/locale.admin.inc
  113. +3 −3 modules/locale/locale.info
  114. +45 −21 modules/locale/locale.module
  115. +36 −6 modules/locale/locale.test
  116. +3 −3 modules/locale/tests/locale_test.info
  117. +1 −1 modules/menu/menu.admin.inc
  118. +4 −4 modules/menu/menu.api.php
  119. +3 −3 modules/menu/menu.info
  120. +1 −1 modules/menu/menu.test
  121. +6 −3 modules/node/content_types.inc
  122. +120 −15 modules/node/node.admin.inc
  123. +3 −3 modules/node/node.info
  124. +2 −0 modules/node/node.install
  125. +97 −10 modules/node/node.pages.inc
  126. +104 −56 modules/node/node.test
  127. +3 −3 modules/node/tests/node_access_test.info
  128. +5 −1 modules/node/tests/node_access_test.module
  129. +3 −3 modules/node/tests/node_test.info
  130. +4 −2 modules/node/tests/node_test.module
  131. +3 −3 modules/node/tests/node_test_exception.info
  132. +1 −2 modules/node/tests/node_test_exception.module
  133. +3 −3 modules/openid/openid.info
  134. +15 −1 modules/openid/openid.module
  135. +3 −3 modules/openid/tests/openid_test.info
  136. +5 −2 modules/overlay/overlay-parent.js
  137. +3 −3 modules/overlay/overlay.info
  138. +1 −1 modules/overlay/overlay.module
  139. +3 −3 modules/path/path.info
  140. +3 −3 modules/php/php.info
  141. +1 −1 modules/php/php.module
  142. +3 −3 modules/poll/poll.info
  143. +3 −3 modules/profile/profile.info
  144. +3 −3 modules/rdf/rdf.info
  145. +7 −2 modules/rdf/rdf.module
  146. +63 −63 modules/rdf/rdf.test
  147. +3 −3 modules/rdf/tests/rdf_test.info
  148. +3 −3 modules/search/search.info
  149. +0 −1 modules/search/search.pages.inc
  150. +3 −3 modules/search/tests/search_embedded_form.info
  151. +3 −3 modules/search/tests/search_extra_type.info
  152. +3 −3 modules/shortcut/shortcut.info
  153. +49 −13 modules/simpletest/drupal_web_test_case.php
  154. +18 −0 modules/simpletest/lib/Drupal/simpletest/Tests/PSR0WebTest.php
  155. +3 −3 modules/simpletest/simpletest.info
  156. +107 −0 modules/simpletest/simpletest.module
  157. +3 −0 modules/simpletest/simpletest.pages.inc
  158. +124 −35 modules/simpletest/simpletest.test
  159. +3 −3 modules/simpletest/tests/actions_loop_test.info
  160. +3 −3 modules/simpletest/tests/ajax_forms_test.info
  161. +3 −3 modules/simpletest/tests/ajax_test.info
  162. +3 −3 modules/simpletest/tests/batch_test.info
  163. +20 −4 modules/simpletest/tests/common.test
  164. +3 −3 modules/simpletest/tests/common_test.info
  165. +3 −3 modules/simpletest/tests/common_test_cron_helper.info
  166. +3 −3 modules/simpletest/tests/database_test.info
  167. +617 −345 modules/simpletest/tests/database_test.test
  168. +3 −3 ...simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
  169. +3 −3 ...letest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
  170. +3 −3 modules/simpletest/tests/entity_cache_test.info
  171. +3 −3 modules/simpletest/tests/entity_cache_test_dependency.info
  172. +3 −3 modules/simpletest/tests/entity_crud_hook_test.info
  173. +3 −3 modules/simpletest/tests/entity_query_access_test.info
  174. +3 −3 modules/simpletest/tests/error_test.info
  175. +9 −0 modules/simpletest/tests/file.test
  176. +3 −3 modules/simpletest/tests/file_test.info
  177. +3 −3 modules/simpletest/tests/filter_test.info
  178. +11 −0 modules/simpletest/tests/form.test
  179. +3 −3 modules/simpletest/tests/form_test.info
  180. +3 −3 modules/simpletest/tests/image_test.info
  181. +3 −3 modules/simpletest/tests/menu_test.info
  182. +3 −3 modules/simpletest/tests/module_test.info
  183. +3 −3 modules/simpletest/tests/path_test.info
  184. +18 −0 modules/simpletest/tests/psr_0_test/lib/Drupal/psr_0_test/Tests/ExampleTest.php
  185. +18 −0 modules/simpletest/tests/psr_0_test/lib/Drupal/psr_0_test/Tests/Nested/NestedExampleTest.php
  186. +12 −0 modules/simpletest/tests/psr_0_test/psr_0_test.info
  187. +1 −0 modules/simpletest/tests/psr_0_test/psr_0_test.module
  188. +3 −3 modules/simpletest/tests/requirements1_test.info
  189. +3 −3 modules/simpletest/tests/requirements2_test.info
  190. +3 −3 modules/simpletest/tests/session_test.info
  191. +3 −3 modules/simpletest/tests/system_dependencies_test.info
  192. +3 −3 modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
  193. +3 −3 modules/simpletest/tests/system_incompatible_core_version_test.info
  194. +3 −3 modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
  195. +3 −3 modules/simpletest/tests/system_incompatible_module_version_test.info
  196. +3 −3 modules/simpletest/tests/system_test.info
  197. +3 −3 modules/simpletest/tests/taxonomy_test.info
  198. +3 −3 modules/simpletest/tests/theme_test.info
  199. +3 −3 modules/simpletest/tests/themes/test_basetheme/test_basetheme.info
  200. +3 −3 modules/simpletest/tests/themes/test_subtheme/test_subtheme.info
  201. +3 −3 modules/simpletest/tests/themes/test_theme/test_theme.info
  202. +3 −3 modules/simpletest/tests/update_script_test.info
  203. +3 −3 modules/simpletest/tests/update_test_1.info
  204. +3 −3 modules/simpletest/tests/update_test_2.info
  205. +3 −3 modules/simpletest/tests/update_test_3.info
  206. +8 −0 modules/simpletest/tests/upgrade/drupal-6.duplicate-permission.database.php
  207. +14 −0 modules/simpletest/tests/upgrade/upgrade.test
  208. +29 −0 modules/simpletest/tests/upgrade/upgrade.user.test
  209. +3 −3 modules/simpletest/tests/url_alter_test.info
  210. +3 −3 modules/simpletest/tests/xmlrpc_test.info
  211. +3 −3 modules/statistics/statistics.info
  212. +3 −3 modules/syslog/syslog.info
  213. +51 −35 modules/system/language.api.php
  214. +6 −0 modules/system/system.admin.inc
  215. +42 −22 modules/system/system.api.php
  216. +3 −3 modules/system/system.info
  217. +27 −7 modules/system/system.install
  218. +12 −11 modules/system/system.module
  219. +31 −0 modules/system/system.test
  220. +4 −0 modules/system/system.updater.inc
  221. +2 −1 modules/taxonomy/taxonomy-term.tpl.php
  222. +3 −3 modules/taxonomy/taxonomy.info
  223. +2 −3 modules/taxonomy/taxonomy.pages.inc
  224. +7 −0 modules/taxonomy/taxonomy.test
  225. +3 −3 modules/toolbar/toolbar.info
  226. +3 −3 modules/tracker/tracker.info
  227. +3 −3 modules/translation/tests/translation_test.info
  228. +3 −3 modules/translation/translation.info
  229. +3 −3 modules/trigger/tests/trigger_test.info
  230. +3 −3 modules/trigger/trigger.info
  231. +3 −3 modules/update/tests/aaa_update_test.info
  232. +3 −3 modules/update/tests/bbb_update_test.info
  233. +3 −3 modules/update/tests/ccc_update_test.info
  234. +3 −3 modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
  235. +3 −3 modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
  236. +3 −3 modules/update/tests/update_test.info
  237. +3 −3 modules/update/update.info
  238. +3 −3 modules/update/update.module
  239. +3 −3 modules/user/tests/user_form_test.info
  240. +15 −0 modules/user/user.admin.inc
  241. +4 −2 modules/user/user.api.php
  242. +3 −3 modules/user/user.info
  243. +19 −1 modules/user/user.module
  244. +1 −1 modules/user/user.pages.inc
  245. +3 −3 profiles/minimal/minimal.info
  246. +3 −3 profiles/standard/standard.info
  247. +3 −3 .../testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
  248. +3 −3 ...ting/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
  249. +3 −3 profiles/testing/testing.info
  250. +3 −1 scripts/run-tests.sh
  251. +0 −5 sites/default/files/texpdf/README.texpdf
  252. +0 −3 sites/default/files/versions/README.versions
  253. +3 −3 themes/bartik/bartik.info
  254. +3 −3 themes/garland/garland.info
  255. +3 −3 themes/seven/seven.info
  256. +3 −0 themes/seven/template.php
  257. +3 −3 themes/stark/stark.info
  258. +31 −7 update.php
View
@@ -4,33 +4,34 @@
* @file
* Administrative script for running authorized file operations.
*
- * Using this script, the site owner (the user actually owning the files on
- * the webserver) can authorize certain file-related operations to proceed
- * with elevated privileges, for example to deploy and upgrade modules or
- * themes. Users should not visit this page directly, but instead use an
- * administrative user interface which knows how to redirect the user to this
- * script as part of a multistep process. This script actually performs the
- * selected operations without loading all of Drupal, to be able to more
- * gracefully recover from errors. Access to the script is controlled by a
- * global killswitch in settings.php ('allow_authorize_operations') and via
- * the 'administer software updates' permission.
+ * Using this script, the site owner (the user actually owning the files on the
+ * webserver) can authorize certain file-related operations to proceed with
+ * elevated privileges, for example to deploy and upgrade modules or themes.
+ * Users should not visit this page directly, but instead use an administrative
+ * user interface which knows how to redirect the user to this script as part of
+ * a multistep process. This script actually performs the selected operations
+ * without loading all of Drupal, to be able to more gracefully recover from
+ * errors. Access to the script is controlled by a global killswitch in
+ * settings.php ('allow_authorize_operations') and via the 'administer software
+ * updates' permission.
*
* There are helper functions for setting up an operation to run via this
* system in modules/system/system.module. For more information, see:
* @link authorize Authorized operation helper functions @endlink
*/
/**
- * Root directory of Drupal installation.
+ * Defines the root directory of the Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
/**
- * Global flag to identify update.php and authorize.php runs, and so
- * avoid various unwanted operations, such as hook_init() and
- * hook_exit() invokes, css/js preprocessing and translation, and
- * solve some theming issues. This flag is checked on several places
- * in Drupal code (not just authorize.php).
+ * Global flag to identify update.php and authorize.php runs.
+ *
+ * Identifies update.php and authorize.php runs, avoiding unwanted operations
+ * such as hook_init() and hook_exit() invokes, css/js preprocessing and
+ * translation, and solves some theming issues. The flag is checked in other
+ * places in Drupal code (not just authorize.php).
*/
define('MAINTENANCE_MODE', 'update');
@@ -51,7 +52,7 @@ function authorize_access_denied_page() {
* have access to the 'administer software updates' permission.
*
* @return
- * TRUE if the current user can run authorize.php, otherwise FALSE.
+ * TRUE if the current user can run authorize.php, and FALSE if not.
*/
function authorize_access_allowed() {
return variable_get('allow_authorize_operations', TRUE) && user_access('administer software updates');
View
@@ -251,8 +251,8 @@ function ajax_render($commands = array()) {
// reliably diffed with array_diff_key(), since the number can change
// due to factors unrelated to the inline content, so for now, we strip
// the inline items from Ajax responses, and can add support for them
- // when drupal_add_css() and drupal_add_js() are changed to using md5()
- // or some other hash of the inline content.
+ // when drupal_add_css() and drupal_add_js() are changed to use a hash
+ // of the inline content as the array key.
foreach ($items[$type] as $key => $item) {
if (is_numeric($key)) {
unset($items[$type][$key]);
@@ -836,7 +836,8 @@ function ajax_command_insert($selector, $html, $settings = NULL) {
* @return
* An array suitable for use with the ajax_render() function.
*
- * See @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
+ * See
+ * @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
*/
function ajax_command_replace($selector, $html, $settings = NULL) {
return array(
@@ -8,7 +8,7 @@
/**
* The current system version.
*/
-define('VERSION', '7.20');
+define('VERSION', '7.22');
/**
* Core API compatibility.
@@ -716,7 +716,6 @@ function drupal_settings_initialize() {
if (isset($base_url)) {
// Parse fixed base URL from settings.php.
$parts = parse_url($base_url);
- $http_protocol = $parts['scheme'];
if (!isset($parts['path'])) {
$parts['path'] = '';
}
@@ -811,7 +810,7 @@ function drupal_settings_initialize() {
* than by consulting the database.
*
* @return
- * The filename of the requested item.
+ * The filename of the requested item or NULL if the item is not found.
*/
function drupal_get_filename($type, $name, $filename = NULL) {
// The location of files will not change during the request, so do not use
@@ -1186,10 +1185,11 @@ function _drupal_set_preferred_header_name($name = NULL) {
* Headers are set in drupal_add_http_header(). Default headers are not set
* if they have been replaced or unset using drupal_add_http_header().
*
- * @param $default_headers
- * An array of headers as name/value pairs.
- * @param $single
- * If TRUE and headers have already be sent, send only the specified header.
+ * @param array $default_headers
+ * (optional) An array of headers as name/value pairs.
+ * @param bool $only_default
+ * (optional) If TRUE and headers have already been sent, send only the
+ * specified headers.
*/
function drupal_send_headers($default_headers = array(), $only_default = FALSE) {
$headers_sent = &drupal_static(__FUNCTION__, FALSE);
@@ -1212,7 +1212,7 @@ function drupal_send_headers($default_headers = array(), $only_default = FALSE)
header($_SERVER['SERVER_PROTOCOL'] . ' ' . $value);
}
// Skip headers that have been unset.
- elseif ($value) {
+ elseif ($value !== FALSE) {
header($header_names[$name_lower] . ': ' . $value);
}
}
@@ -1420,8 +1420,9 @@ function drupal_unpack($obj, $field = 'data') {
* Basically, you can put variables like @name into your string, and t() will
* substitute their sanitized values at translation time. (See the
* Localization API pages referenced above and the documentation of
- * format_string() for details.) Translators can then rearrange the string as
- * necessary for the language (e.g., in Spanish, it might be "blog de @name").
+ * format_string() for details about how to define variables in your string.)
+ * Translators can then rearrange the string as necessary for the language
+ * (e.g., in Spanish, it might be "blog de @name").
*
* During the Drupal installation phase, some resources used by t() wil not be
* available to code that needs localization. See st() and get_t() for
@@ -1484,21 +1485,34 @@ function t($string, array $args = array(), array $options = array()) {
}
/**
- * Replaces placeholders with sanitized values in a string.
+ * Formats a string for HTML display by replacing variable placeholders.
+ *
+ * This function replaces variable placeholders in a string with the requested
+ * values and escapes the values so they can be safely displayed as HTML. It
+ * should be used on any unknown text that is intended to be printed to an HTML
+ * page (especially text that may have come from untrusted users, since in that
+ * case it prevents cross-site scripting and other security problems).
+ *
+ * In most cases, you should use t() rather than calling this function
+ * directly, since it will translate the text (on non-English-only sites) in
+ * addition to formatting it.
*
* @param $string
* A string containing placeholders.
* @param $args
* An associative array of replacements to make. Occurrences in $string of
- * any key in $args are replaced with the corresponding value, after
- * sanitization. The sanitization function depends on the first character of
- * the key:
- * - !variable: Inserted as is. Use this for text that has already been
- * sanitized.
- * - @variable: Escaped to HTML using check_plain(). Use this for anything
- * displayed on a page on the site.
- * - %variable: Escaped as a placeholder for user-submitted content using
- * drupal_placeholder(), which shows up as <em>emphasized</em> text.
+ * any key in $args are replaced with the corresponding value, after optional
+ * sanitization and formatting. The type of sanitization and formatting
+ * depends on the first character of the key:
+ * - @variable: Escaped to HTML using check_plain(). Use this as the default
+ * choice for anything displayed on a page on the site.
+ * - %variable: Escaped to HTML and formatted using drupal_placeholder(),
+ * which makes it display as <em>emphasized</em> text.
+ * - !variable: Inserted as is, with no sanitization or formatting. Only use
+ * this for text that has already been prepared for HTML display (for
+ * example, user-supplied text that has already been run through
+ * check_plain() previously, or is expected to contain some limited HTML
+ * tags and has already been run through filter_xss() previously).
*
* @see t()
* @ingroup sanitization
View
@@ -80,43 +80,15 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
* same name. Other implementations might want to store several bins in data
* structures that get flushed together. While it is not a problem for most
* cache bins if the entries in them are flushed before their expire time, some
- * might break functionality or are extremely expensive to recalculate. These
- * will be marked with a (*). The other bins expired automatically by core.
- * Contributed modules can add additional bins and get them expired
- * automatically by implementing hook_flush_caches().
- *
- * - cache: Generic cache storage bin (used for variables, theme registry,
- * locale date, list of simpletest tests etc).
- *
- * - cache_block: Stores the content of various blocks.
- *
- * - cache field: Stores the field data belonging to a given object.
- *
- * - cache_filter: Stores filtered pieces of content.
- *
- * - cache_form(*): Stores multistep forms. Flushing this bin means that some
- * forms displayed to users lose their state and the data already submitted
- * to them.
- *
- * - cache_menu: Stores the structure of visible navigation menus per page.
- *
- * - cache_page: Stores generated pages for anonymous users. It is flushed
- * very often, whenever a page changes, at least for every ode and comment
- * submission. This is the only bin affected by the page cache setting on
- * the administrator panel.
- *
- * - cache path: Stores the system paths that have an alias.
- *
- * - cache update(*): Stores available releases. The update server (for
- * example, drupal.org) needs to produce the relevant XML for every project
- * installed on the current site. As this is different for (almost) every
- * site, it's very expensive to recalculate for the update server.
+ * might break functionality or are extremely expensive to recalculate. The
+ * other bins are expired automatically by core. Contributed modules can add
+ * additional bins and get them expired automatically by implementing
+ * hook_flush_caches().
*
* The reasons for having several bins are as follows:
- *
- * - smaller bins mean smaller database tables and allow for faster selects and
- * inserts
- * - we try to put fast changing cache items and rather static ones into
+ * - Smaller bins mean smaller database tables and allow for faster selects and
+ * inserts.
+ * - We try to put fast changing cache items and rather static ones into
* different bins. The effect is that only the fast changing bins will need a
* lot of writes to disk. The more static bins will also be better cacheable
* with MySQL's query cache.
@@ -125,13 +97,27 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
* The cache ID of the data to store.
* @param $data
* The data to store in the cache. Complex data types will be automatically
- * serialized before insertion.
- * Strings will be stored as plain text and not serialized.
+ * serialized before insertion. Strings will be stored as plain text and are
+ * not serialized.
* @param $bin
- * The cache bin to store the data in. Valid core values are 'cache_block',
- * 'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form',
- * 'cache_menu', 'cache_page', 'cache_update' or 'cache' for the default
- * cache.
+ * The cache bin to store the data in. Valid core values are:
+ * - cache: (default) Generic cache storage bin (used for theme registry,
+ * locale date, list of simpletest tests, etc.).
+ * - cache_block: Stores the content of various blocks.
+ * - cache_bootstrap: Stores the class registry, the system list of modules,
+ * the list of which modules implement which hooks, and the Drupal variable
+ * list.
+ * - cache_field: Stores the field data belonging to a given object.
+ * - cache_filter: Stores filtered pieces of content.
+ * - cache_form: Stores multistep forms. Flushing this bin means that some
+ * forms displayed to users lose their state and the data already submitted
+ * to them. This bin should not be flushed before its expired time.
+ * - cache_menu: Stores the structure of visible navigation menus per page.
+ * - cache_page: Stores generated pages for anonymous users. It is flushed
+ * very often, whenever a page changes, at least for every node and comment
+ * submission. This is the only bin affected by the page cache setting on
+ * the administrator panel.
+ * - cache_path: Stores the system paths that have an alias.
* @param $expire
* One of the following values:
* - CACHE_PERMANENT: Indicates that the item should never be removed unless
@@ -141,6 +127,7 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
* - A Unix timestamp: Indicates that the item should be kept at least until
* the given time, after which it behaves like CACHE_TEMPORARY.
*
+ * @see _update_cache_set()
* @see cache_get()
*/
function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
View
@@ -281,7 +281,7 @@ function drupal_get_rdf_namespaces() {
/**
* Adds output to the HEAD tag of the HTML page.
*
- * This function can be called as long the headers aren't sent. Pass no
+ * This function can be called as long as the headers aren't sent. Pass no
* arguments (or NULL for both) to retrieve the currently stored elements.
*
* @param $data
@@ -785,6 +785,13 @@ function drupal_access_denied() {
* - data: A string containing the response body that was received.
*/
function drupal_http_request($url, array $options = array()) {
+ // Allow an alternate HTTP client library to replace Drupal's default
+ // implementation.
+ $override_function = variable_get('drupal_http_request_function', FALSE);
+ if (!empty($override_function) && function_exists($override_function)) {
+ return $override_function($url, $options);
+ }
+
$result = new stdClass();
// Parse the URL and make sure we can handle the schema.
@@ -1167,7 +1174,8 @@ function fix_gpc_magic() {
/**
* Verifies the syntax of the given e-mail address.
*
- * See @link http://tools.ietf.org/html/rfc5321 RFC 5321 @endlink for details.
+ * This uses the
+ * @link http://php.net/manual/filter.filters.validate.php PHP e-mail validation filter. @endlink
*
* @param $mail
* A string containing an e-mail address.
@@ -2379,6 +2387,14 @@ function drupal_attributes(array $attributes = array()) {
* internal links output by modules should be generated by this function if
* possible.
*
+ * However, for links enclosed in translatable text you should use t() and
+ * embed the HTML anchor tag directly in the translated string. For example:
+ * @code
+ * t('Visit the <a href="@url">settings</a> page', array('@url' => url('admin')));
+ * @endcode
+ * This keeps the context of the link title ('settings' in the example) for
+ * translators.
+ *
* @param string $text
* The translated link text for the anchor tag.
* @param string $path
@@ -2779,7 +2795,7 @@ function drupal_set_time_limit($time_limit) {
* The name of the item for which the path is requested.
*
* @return
- * The path to the requested item.
+ * The path to the requested item or an empty string if the item is not found.
*/
function drupal_get_path($type, $name) {
return dirname(drupal_get_filename($type, $name));
@@ -3869,7 +3885,16 @@ function drupal_html_id($id) {
// requested id. $_POST['ajax_html_ids'] contains the ids as they were
// returned by this function, potentially with the appended counter, so
// we parse that to reconstruct the $seen_ids array.
- foreach ($_POST['ajax_html_ids'] as $seen_id) {
+ if (is_array($_POST['ajax_html_ids'])) {
+ $ajax_html_ids = $_POST['ajax_html_ids'];
+ }
+ else {
+ // jquery.form.js may send the server a comma-separated string instead
+ // of an array (see http://drupal.org/node/1575060), so we need to
+ // convert it to an array in that case.
+ $ajax_html_ids = explode(',', $_POST['ajax_html_ids']);
+ }
+ foreach ($ajax_html_ids as $seen_id) {
// We rely on '--' being used solely for separating a base id from the
// counter, which this function ensures when returning an id.
$parts = explode('--', $seen_id, 2);
@@ -5038,6 +5063,11 @@ function drupal_get_private_key() {
*
* @param $value
* An additional value to base the token on.
+ *
+ * @return string
+ * A 43-character URL-safe token for validation, based on the user session ID,
+ * the global $drupal_hash_salt variable from settings.php, and the
+ * 'drupal_private_key' configuration variable.
*/
function drupal_get_token($value = '') {
return drupal_hmac_base64($value, session_id() . drupal_get_private_key() . drupal_get_hash_salt());
@@ -5568,7 +5598,7 @@ function drupal_pre_render_link($element) {
* @code
* $node->content['links'] = array(
* '#theme' => 'links__node',
- * '#pre_render' = array('drupal_pre_render_links'),
+ * '#pre_render' => array('drupal_pre_render_links'),
* 'comment' => array(
* '#theme' => 'links__node__comment',
* '#links' => array(
Oops, something went wrong.

0 comments on commit f123eb7

Please sign in to comment.