Browse Source

updated core with drupal.rb

DEV-updatecore
Bèr Kessels 11 years ago
parent
commit
be67ccaf13
89 changed files with 1180 additions and 462 deletions
  1. 30
    3
      CHANGELOG.txt
  2. 13
    9
      includes/actions.inc
  3. 3
    1
      includes/bootstrap.inc
  4. 2
    2
      includes/cache.inc
  5. 28
    18
      includes/common.inc
  6. 22
    1
      includes/database.inc
  7. 2
    2
      includes/database.mysql-common.inc
  8. 1
    26
      includes/database.mysql.inc
  9. 1
    26
      includes/database.mysqli.inc
  10. 1
    24
      includes/database.pgsql.inc
  11. 21
    10
      includes/file.inc
  12. 45
    38
      includes/form.inc
  13. 52
    11
      includes/locale.inc
  14. 234
    0
      includes/lock.inc
  15. 41
    7
      includes/menu.inc
  16. 23
    11
      includes/module.inc
  17. 4
    4
      includes/path.inc
  18. 6
    4
      includes/session.inc
  19. 55
    9
      includes/theme.inc
  20. 3
    3
      includes/theme.maintenance.inc
  21. 5
    2
      includes/xmlrpcs.inc
  22. 16
    10
      install.php
  23. 2
    2
      misc/teaser.js
  24. 3
    3
      modules/aggregator/aggregator.info
  25. 3
    3
      modules/block/block.info
  26. 27
    1
      modules/block/block.module
  27. 3
    3
      modules/blog/blog.info
  28. 3
    3
      modules/blogapi/blogapi.info
  29. 3
    3
      modules/book/book.info
  30. 3
    3
      modules/color/color.info
  31. 2
    3
      modules/comment/comment.admin.inc
  32. 3
    3
      modules/comment/comment.info
  33. 19
    11
      modules/comment/comment.module
  34. 2
    2
      modules/contact/contact.admin.inc
  35. 3
    3
      modules/contact/contact.info
  36. 30
    10
      modules/contact/contact.module
  37. 3
    3
      modules/dblog/dblog.info
  38. 4
    1
      modules/dblog/dblog.module
  39. 3
    3
      modules/filter/filter.info
  40. 2
    2
      modules/filter/filter.module
  41. 3
    3
      modules/forum/forum.info
  42. 2
    2
      modules/forum/forum.module
  43. 3
    3
      modules/help/help.info
  44. 3
    3
      modules/locale/locale.info
  45. 42
    3
      modules/locale/locale.install
  46. 14
    5
      modules/locale/locale.module
  47. 3
    2
      modules/menu/menu.admin.inc
  48. 3
    3
      modules/menu/menu.info
  49. 3
    3
      modules/node/node.info
  50. 34
    29
      modules/node/node.module
  51. 5
    2
      modules/openid/openid.inc
  52. 3
    3
      modules/openid/openid.info
  53. 28
    7
      modules/openid/openid.module
  54. 3
    3
      modules/path/path.info
  55. 3
    3
      modules/php/php.info
  56. 3
    3
      modules/ping/ping.info
  57. 4
    2
      modules/ping/ping.module
  58. 3
    3
      modules/poll/poll.info
  59. 2
    3
      modules/profile/profile.admin.inc
  60. 3
    3
      modules/profile/profile.info
  61. 3
    3
      modules/search/search.info
  62. 1
    2
      modules/search/search.module
  63. 3
    3
      modules/statistics/statistics.info
  64. 3
    3
      modules/syslog/syslog.info
  65. 2
    3
      modules/system/system.admin.inc
  66. 3
    3
      modules/system/system.info
  67. 76
    3
      modules/system/system.install
  68. 3
    3
      modules/system/system.module
  69. 3
    3
      modules/taxonomy/taxonomy.info
  70. 15
    3
      modules/taxonomy/taxonomy.module
  71. 3
    3
      modules/throttle/throttle.info
  72. 3
    3
      modules/tracker/tracker.info
  73. 3
    3
      modules/translation/translation.info
  74. 3
    3
      modules/trigger/trigger.info
  75. 70
    4
      modules/update/update.compare.inc
  76. 3
    3
      modules/update/update.info
  77. 3
    3
      modules/update/update.module
  78. 24
    2
      modules/update/update.report.inc
  79. 3
    3
      modules/upload/upload.info
  80. 5
    7
      modules/user/user-profile.tpl.php
  81. 12
    3
      modules/user/user.admin.inc
  82. 3
    3
      modules/user/user.info
  83. 22
    4
      modules/user/user.module
  84. 3
    3
      themes/bluemarine/bluemarine.info
  85. 3
    3
      themes/chameleon/chameleon.info
  86. 3
    3
      themes/chameleon/marvin/marvin.info
  87. 3
    3
      themes/garland/garland.info
  88. 3
    3
      themes/garland/minnelli/minnelli.info
  89. 3
    3
      themes/pushbutton/pushbutton.info

+ 30
- 3
CHANGELOG.txt View File

@@ -1,4 +1,21 @@
// $Id: CHANGELOG.txt,v 1.253.2.33 2009/09/16 19:34:13 goba Exp $
// $Id: CHANGELOG.txt,v 1.253.2.37 2010/03/04 00:15:28 goba Exp $

Drupal 6.16, 2010-03-03
----------------------
- Fixed security issues (Installation cross site scripting, Open redirection,
Locale module cross site scripting, Blocked user session regeneration),
see SA-CORE-2010-001.
- Better support for updated jQuery versions.
- Reduced resource usage of update.module.
- Fixed several issues relating to support of install profiles and
distributions.
- Added a locking framework to avoid data corruption on long operations.
- Fixed a variety of other bugs.

Drupal 6.15, 2009-12-16
----------------------
- Fixed security issues (Cross site scripting), see SA-CORE-2009-009.
- Fixed a variety of other bugs.

Drupal 6.14, 2009-09-16
----------------------
@@ -89,7 +106,7 @@ Drupal 6.3, 2008-07-09
- Fixed Views compatibility issues (Views for Drupal 6 requires Drupal 6.3+).
- Fixed a variety of small bugs.

Drupal 6.2, 2008-04-09
Drupal 6.2, 2008-04-09
----------------------
- Fixed a variety of small bugs.
- Fixed a security issue (Access bypasses), see SA-2008-026.
@@ -201,6 +218,16 @@ Drupal 6.0, 2008-02-13
- Removed old system updates. Updates from Drupal versions prior to 5.x will
require upgrading to 5.x before upgrading to 6.x.

Drupal 5.22, 2010-03-03
-----------------------
- Fixed security issues (Open redirection, Locale module cross site scripting,
Blocked user session regeneration), see SA-CORE-2010-001.

Drupal 5.21, 2009-12-16
-----------------------
- Fixed a security issue (Cross site scripting), see SA-CORE-2009-009.
- Fixed a variety of small bugs.

Drupal 5.20, 2009-09-16
-----------------------
- Avoid security problems resulting from writing Drupal 6-style menu declarations.
@@ -242,7 +269,7 @@ Drupal 5.13, 2008-12-10
-----------------------
- fixed a variety of small bugs.
- fixed security issues, (Cross site request forgery and Cross site scripting), see SA-2008-073
- updated robots.txt and .htaccess to match current file use.
- updated robots.txt and .htaccess to match current file use.

Drupal 5.12, 2008-10-22
-----------------------

+ 13
- 9
includes/actions.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: actions.inc,v 1.8.2.9 2009/08/10 10:39:49 goba Exp $
// $Id: actions.inc,v 1.8.2.10 2009/11/06 08:14:05 goba Exp $

/**
* @file
@@ -167,17 +167,21 @@ function actions_list($reset = FALSE) {
}

/**
* Retrieve all action instances from the database.
* Retrieves all action instances from the database.
*
* Compare with actions_list() which gathers actions by
* invoking hook_action_info(). The two are synchronized
* by visiting /admin/build/actions (when actions.module is
* enabled) which runs actions_synchronize().
* Compare with actions_list(), which gathers actions by invoking
* hook_action_info(). The actions returned by this function and the actions
* returned by actions_list() are partially synchronized. Non-configurable
* actions from hook_action_info() implementations are put into the database
* when actions_synchronize() is called, which happens when
* admin/settings/actions is visited. Configurable actions are not added to
* the database until they are configured in the user interface, in which case
* a database row is created for each configuration of each action.
*
* @return
* Associative array keyed by action ID. Each value is
* an associative array with keys 'callback', 'description',
* 'type' and 'configurable'.
* Associative array keyed by action ID. Each value is an
* associative array with keys 'callback', 'description', 'type' and
* 'configurable'.
*/
function actions_get_all_actions() {
$actions = array();

+ 3
- 1
includes/bootstrap.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: bootstrap.inc,v 1.206.2.13 2009/09/14 13:33:39 goba Exp $
// $Id: bootstrap.inc,v 1.206.2.14 2010/02/01 16:49:14 goba Exp $

/**
* @file
@@ -1060,6 +1060,8 @@ function _drupal_bootstrap($phase) {
exit;
}
// Prepare for non-cached page workflow.
require_once variable_get('lock_inc', './includes/lock.inc');
lock_init();
drupal_page_header();
break;


+ 2
- 2
includes/cache.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: cache.inc,v 1.17.2.3 2009/08/10 10:43:55 goba Exp $
// $Id: cache.inc,v 1.17.2.4 2009/12/16 17:30:00 goba Exp $

/**
* Return data from the persistent cache. Data may be stored as either plain text or as serialized data.
@@ -169,7 +169,7 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
else {
if ($wildcard) {
if ($cid == '*') {
db_query("DELETE FROM {". $table ."}");
db_query("TRUNCATE TABLE {". $table ."}");
}
else {
db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);

+ 28
- 18
includes/common.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: common.inc,v 1.756.2.69 2009/09/16 19:34:14 goba Exp $
// $Id: common.inc,v 1.756.2.79 2010/03/04 00:15:28 goba Exp $

/**
* @file
@@ -311,11 +311,21 @@ function drupal_get_destination() {
*/
function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302) {

$destination = FALSE;
if (isset($_REQUEST['destination'])) {
extract(parse_url(urldecode($_REQUEST['destination'])));
$destination = $_REQUEST['destination'];
}
else if (isset($_REQUEST['edit']['destination'])) {
extract(parse_url(urldecode($_REQUEST['edit']['destination'])));
$destination = $_REQUEST['edit']['destination'];
}

if ($destination) {
// Do not redirect to an absolute URL originating from user input.
$colonpos = strpos($destination, ':');
$absolute = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($destination, 0, $colonpos)));
if (!$absolute) {
extract(parse_url(urldecode($destination)));
}
}

$url = url($path, array('query' => $query, 'fragment' => $fragment, 'absolute' => TRUE));
@@ -617,7 +627,7 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
return;
}

if ($errno & (E_ALL ^ E_NOTICE ^ 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
@@ -1110,7 +1120,7 @@ function format_xml_elements($array) {
$output .= drupal_attributes($value['attributes']);
}

if ($value['value'] != '') {
if (isset($value['value']) && $value['value'] != '') {
$output .= '>'. (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) .'</'. $value['key'] .">\n";
}
else {
@@ -1726,7 +1736,7 @@ function drupal_clone($object) {
* Add a <link> tag to the page's HEAD.
*/
function drupal_add_link($attributes) {
drupal_set_html_head('<link'. drupal_attributes($attributes) ." />\n");
drupal_set_html_head('<link'. drupal_attributes($attributes) .' />');
}

/**
@@ -2009,8 +2019,7 @@ function drupal_load_stylesheet($file, $optimize = NULL) {
// Perform some safe CSS optimizations.
$contents = preg_replace('<
\s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses.
/\*([^*\\\\]|\*(?!/))+\*/ | # Remove comments that are not CSS hacks.
[\n\r] # Remove line breaks.
/\*([^*\\\\]|\*(?!/))+\*/ # Remove comments that are not CSS hacks.
>x', '\1', $contents);
}

@@ -2662,7 +2671,7 @@ function page_set_cache() {
function drupal_cron_run() {
// Try to allocate enough time to run all the hook_cron implementations.
if (function_exists('set_time_limit')) {
@set_time_limit($time_limit);
@set_time_limit(240);
}

// Fetch the cron semaphore
@@ -3496,7 +3505,7 @@ function drupal_write_record($table, &$object, $update = array()) {
* White-space generally doesn't matter, except inside values.
* e.g.
*
* @verbatim
* @code
* key = value
* key = "value"
* key = 'value'
@@ -3509,16 +3518,16 @@ function drupal_write_record($table, &$object, $update = array()) {
* key
* =
* 'value'
* @endverbatim
* @endcode
*
* Arrays are created using a GET-like syntax:
*
* @verbatim
* @code
* key[] = "numeric array"
* key[index] = "associative array"
* key[index][] = "nested numeric array"
* key[index][index] = "nested associative array"
* @endverbatim
* @endcode
*
* PHP constants are substituted in, but only when used as the entire value:
*
@@ -3534,14 +3543,14 @@ function drupal_write_record($table, &$object, $update = array()) {
* - package: The name of the package of modules this module belongs to.
*
* Example of .info file:
* @verbatim
* @code
* name = Forum
* description = Enables threaded discussions about general topics.
* dependencies[] = taxonomy
* dependencies[] = comment
* package = Core - optional
* version = VERSION
* @endverbatim
* @endcode
*
* @param $filename
* The file we are parsing. Accepts file with relative or absolute path.
@@ -3550,6 +3559,7 @@ function drupal_write_record($table, &$object, $update = array()) {
*/
function drupal_parse_info_file($filename) {
$info = array();
$constants = get_defined_constants();

if (!file_exists($filename)) {
return $info;
@@ -3593,9 +3603,9 @@ function drupal_parse_info_file($filename) {
$parent = &$parent[$key];
}

// Handle PHP constants
if (defined($value)) {
$value = constant($value);
// Handle PHP constants.
if (isset($constants[$value])) {
$value = $constants[$value];
}

// Insert actual value

+ 22
- 1
includes/database.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: database.inc,v 1.92.2.8 2009/09/14 10:49:34 goba Exp $
// $Id: database.inc,v 1.92.2.9 2010/02/01 16:32:10 goba Exp $

/**
* @file
@@ -388,6 +388,27 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
return $query;
}

/**
* Adds the DISTINCT flag to the supplied query if a DISTINCT doesn't already
* exist in the query. Returns the altered query.
*
* This will not, and never did guarantee that you will obtain distinct
* values of $table.$field.
*
* @param $table Unused. Kept to remain API compatibility.
* @param $field Unused. Kept to remain API compatibility.
* @param $query Query to which the DISTINCT flag should be applied.
* @return SQL query with the DISTINCT flag set.
*/
function db_distinct_field($table, $field, $query) {
$matches = array();
if (!preg_match('/^SELECT\s*DISTINCT/i', $query, $matches)) {
// Only add distinct to the outer SELECT to avoid messing up subqueries.
$query = preg_replace('/^SELECT/i', 'SELECT DISTINCT', $query);
}
return $query;
}

/**
* Restrict a dynamic table, column or constraint name to safe characters.
*

+ 2
- 2
includes/database.mysql-common.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: database.mysql-common.inc,v 1.17.2.3 2009/09/14 10:49:34 goba Exp $
// $Id: database.mysql-common.inc,v 1.17.2.4 2010/03/01 10:37:30 goba Exp $

/**
* @file
@@ -335,7 +335,7 @@ function db_drop_field(&$ret, $table, $field) {
* Default value to be set. NULL for 'default NULL'.
*/
function db_field_set_default(&$ret, $table, $field, $default) {
if ($default == NULL) {
if ($default === NULL) {
$default = 'NULL';
}
else {

+ 1
- 26
includes/database.mysql.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: database.mysql.inc,v 1.89.2.1 2009/07/21 08:52:29 goba Exp $
// $Id: database.mysql.inc,v 1.89.2.2 2010/02/01 16:32:10 goba Exp $

/**
* @file
@@ -349,31 +349,6 @@ function db_column_exists($table, $column) {
return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'"));
}

/**
* Wraps the given table.field entry with a DISTINCT(). The wrapper is added to
* the SELECT list entry of the given query and the resulting query is returned.
* This function only applies the wrapper if a DISTINCT doesn't already exist in
* the query.
*
* @param $table Table containing the field to set as DISTINCT
* @param $field Field to set as DISTINCT
* @param $query Query to apply the wrapper to
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
$field_to_select = 'DISTINCT('. $table .'.'. $field .')';
$matches = array();
if (preg_match('/^SELECT(.*?)FROM(.*)/is', $query, $matches)) {
$select = preg_replace(
'/((?:^|,)\s*)(?<!DISTINCT\()(?:'. $table .'\.)?'. $field .'(\s*(?:,|$))/is',
'\1'. $field_to_select .'\2', $matches[1], 1
);
return 'SELECT'. $select .'FROM'. $matches[2];
}
return $query;
}

/**
* @} End of "ingroup database".
*/

+ 1
- 26
includes/database.mysqli.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: database.mysqli.inc,v 1.54.2.1 2009/07/21 08:52:30 goba Exp $
// $Id: database.mysqli.inc,v 1.54.2.2 2010/02/01 16:32:10 goba Exp $

/**
* @file
@@ -351,31 +351,6 @@ function db_column_exists($table, $column) {
return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'"));
}

/**
* Wraps the given table.field entry with a DISTINCT(). The wrapper is added to
* the SELECT list entry of the given query and the resulting query is returned.
* This function only applies the wrapper if a DISTINCT doesn't already exist in
* the query.
*
* @param $table Table containing the field to set as DISTINCT
* @param $field Field to set as DISTINCT
* @param $query Query to apply the wrapper to
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
$field_to_select = 'DISTINCT('. $table .'.'. $field .')';
$matches = array();
if (preg_match('/^SELECT(.*?)FROM(.*)/is', $query, $matches)) {
$select = preg_replace(
'/((?:^|,)\s*)(?<!DISTINCT\()(?:'. $table .'\.)?'. $field .'(\s*(?:,|$))/is',
'\1'. $field_to_select .'\2', $matches[1], 1
);
return 'SELECT'. $select .'FROM'.$matches[2];
}
return $query;
}

/**
* @} End of "ingroup database".
*/

+ 1
- 24
includes/database.pgsql.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: database.pgsql.inc,v 1.68.2.7 2009/09/14 10:49:34 goba Exp $
// $Id: database.pgsql.inc,v 1.68.2.8 2010/02/01 16:32:10 goba Exp $

/**
* @file
@@ -407,29 +407,6 @@ function db_check_setup() {
}
}

/**
* Wraps the given table.field entry with a DISTINCT(). The wrapper is added to
* the SELECT list entry of the given query and the resulting query is returned.
* This function only applies the wrapper if a DISTINCT doesn't already exist in
* the query.
*
* @param $table Table containing the field to set as DISTINCT
* @param $field Field to set as DISTINCT
* @param $query Query to apply the wrapper to
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
if (!preg_match('/FROM\s+\S+\s+AS/si', $query)
&& !preg_match('/DISTINCT\s+ON\s*\(\s*(' . $table . '\s*\.\s*)?' . $field . '\s*\)/si', $query)
&& !preg_match('/DISTINCT[ (]' . $field . '/si', $query)
&& preg_match('/(.*FROM\s+)(.*?\s)(\s*(WHERE|GROUP|HAVING|ORDER|LIMIT|FOR).*)/Asi', $query, $m)) {
$query = $m[1];
$query .= preg_replace('/([\{\w+\}]+)\s+(' . $table . ')\s/Usi', '(SELECT DISTINCT ON (' . $field . ') * FROM \1) \2 ', $m[2]);
$query .= $m[3];
}
return $query;
}

/**
* @} End of "ingroup database".
*/

+ 21
- 10
includes/file.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: file.inc,v 1.121.2.9 2009/09/16 19:34:14 goba Exp $
// $Id: file.inc,v 1.121.2.11 2010/03/01 09:51:16 goba Exp $

/**
* @file
@@ -342,15 +342,24 @@ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
}

/**
* Munge the filename as needed for security purposes. For instance the file
* name "exploit.php.pps" would become "exploit.php_.pps".
* Modify a filename as needed for security purposes.
*
* @param $filename The name of a file to modify.
* @param $extensions A space separated list of extensions that should not
* be altered.
* @param $alerts Whether alerts (watchdog, drupal_set_message()) should be
* displayed.
* @return $filename The potentially modified $filename.
* Dangerous file names will be altered; for instance, the file name
* "exploit.php.pps" will become "exploit.php_.pps". All extensions that are
* between 2 and 5 characters in length, internal to the file name, and not
* included in $extensions will be altered by adding an underscore. If variable
* 'allow_insecure_uploads' evaluates to TRUE, no alterations will be made.
*
* @param $filename
* File name to modify.
* @param $extensions
* A space-separated list of extensions that should not be altered.
* @param $alerts
* If TRUE, drupal_set_message() will be called to display a message if the
* file name was changed.
*
* @return
* The potentially modified $filename.
*/
function file_munge_filename($filename, $extensions, $alerts = TRUE) {
$original = $filename;
@@ -1194,6 +1203,7 @@ function file_get_mimetype($filename, $mapping = NULL) {
'au|snd' => 'audio/basic',
'mid|midi|kar' => 'audio/midi',
'mpga|mpega|mp2|mp3|m4a' => 'audio/mpeg',
'f4a|f4b' => 'audio/mp4',
'm3u' => 'audio/x-mpegurl',
'oga|spx' => 'audio/ogg',
'sid' => 'audio/prs.sid',
@@ -1332,7 +1342,8 @@ function file_get_mimetype($filename, $mapping = NULL) {
'fli' => 'video/fli',
'gl' => 'video/gl',
'mpeg|mpg|mpe' => 'video/mpeg',
'mp4' => 'video/mp4',
'mp4|f4v|f4p' => 'video/mp4',
'flv' => 'video/x-flv',
'ogv' => 'video/ogg',
'qt|mov' => 'video/quicktime',
'mxu' => 'video/vnd.mpegurl',

+ 45
- 38
includes/form.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: form.inc,v 1.265.2.28 2009/09/16 17:54:19 goba Exp $
// $Id: form.inc,v 1.265.2.32 2010/03/01 09:24:22 goba Exp $

/**
* @defgroup forms Form builder functions
@@ -48,7 +48,7 @@

/**
* Retrieves a form from a constructor function, or from the cache if
* the form was built in a previous page-load. The form is then passesed
* the form was built in a previous page-load. The form is then passed
* on for processing, after and rendered for display if necessary.
*
* @param $form_id
@@ -132,13 +132,13 @@ function drupal_get_form($form_id) {
// fields.
//
// If $form_state['storage'] or $form_state['rebuild'] has been set
// and the form has been submitted, we know that we're in a complex
// multi-part process of some sort and the form's workflow is NOT
// and input has been processed, we know that we're in a complex
// multi-part process of some sort and the form's workflow is NOT
// complete. We need to construct a fresh copy of the form, passing
// in the latest $form_state in addition to any other variables passed
// into drupal_get_form().

if ((!empty($form_state['storage']) || !empty($form_state['rebuild'])) && !empty($form_state['submitted']) && !form_get_errors()) {
if ((!empty($form_state['storage']) || !empty($form_state['rebuild'])) && !empty($form_state['process_input']) && !form_get_errors()) {
$form = drupal_rebuild_form($form_id, $form_state, $args);
}

@@ -276,7 +276,8 @@ function form_get_cache($form_build_id, &$form_state) {
* $form_state = array();
* $form_state['values']['name'] = 'robo-user';
* $form_state['values']['mail'] = 'robouser@example.com';
* $form_state['values']['pass'] = 'password';
* $form_state['values']['pass']['pass1'] = 'password';
* $form_state['values']['pass']['pass2'] = 'password';
* $form_state['values']['op'] = t('Create new account');
* drupal_execute('user_register', $form_state);
*
@@ -400,6 +401,7 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// Only process the form if it is programmed or the form_id coming
// from the POST data is set and matches the current form_id.
if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (isset($form['#post']['form_id']) && ($form['#post']['form_id'] == $form_id)))) {
$form_state['process_input'] = TRUE;
drupal_validate_form($form_id, $form, $form_state);

// form_clean_id() maintains a cache of element IDs it has seen,
@@ -2314,12 +2316,18 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* array('my_function_2', array()),
* ),
* 'finished' => 'my_finished_callback',
* 'file' => 'path_to_file_containing_myfunctions',
* );
* batch_set($batch);
* // only needed if not inside a form _submit handler :
* batch_process();
* @endcode
*
* Note: if the batch 'title', 'init_message', 'progress_message', or
* 'error_message' could contain any user input, it is the responsibility of
* the code calling batch_set() to sanitize them first with a function like
* check_plain() or filter_xss().
*
* Sample batch operations:
* @code
* // Simple and artificial: load a node of a given type for a given user
@@ -2387,38 +2395,37 @@ function form_clean_id($id = NULL, $flush = FALSE) {
*/

/**
* Open a new batch.
* Opens a new batch.
*
* @param $batch
* An array defining the batch. The following keys can be used:
* 'operations': an array of function calls to be performed.
* Example:
* @code
* array(
* array('my_function_1', array($arg1)),
* array('my_function_2', array($arg2_1, $arg2_2)),
* )
* @endcode
* All the other values below are optional.
* batch_init() provides default values for the messages.
* 'title': title for the progress page.
* Defaults to t('Processing').
* 'init_message': message displayed while the processing is initialized.
* Defaults to t('Initializing.').
* 'progress_message': message displayed while processing the batch.
* Available placeholders are @current, @remaining, @total and @percent.
* Defaults to t('Remaining @remaining of @total.').
* 'error_message': message displayed if an error occurred while processing
* the batch.
* Defaults to t('An error has occurred.').
* 'finished': the name of a function to be executed after the batch has
* completed. This should be used to perform any result massaging that
* may be needed, and possibly save data in $_SESSION for display after
* final page redirection.
* 'file': the path to the file containing the definitions of the
* 'operations' and 'finished' functions, for instance if they don't
* reside in the original '.module' file. The path should be relative to
* the base_path(), and thus should be built using drupal_get_path().
* An array defining the batch. The following keys can be used -- only
* 'operations' is required, and batch_init() provides default values for
* the messages.
* - 'operations': Array of function calls to be performed.
* Example:
* @code
* array(
* array('my_function_1', array($arg1)),
* array('my_function_2', array($arg2_1, $arg2_2)),
* )
* @endcode
* - 'title': Title for the progress page. Only safe strings should be passed.
* Defaults to t('Processing').
* - 'init_message': Message displayed while the processing is initialized.
* Defaults to t('Initializing.').
* - 'progress_message': Message displayed while processing the batch.
* Available placeholders are @current, @remaining, @total, @percentage,
* @estimate and @elapsed. Defaults to t('Completed @current of @total.').
* - 'error_message': Message displayed if an error occurred while processing
* the batch. Defaults to t('An error has occurred.').
* - 'finished': Name of a function to be executed after the batch has
* completed. This should be used to perform any result massaging that
* may be needed, and possibly save data in $_SESSION for display after
* final page redirection.
* - 'file': Path to the file containing the definitions of the
* 'operations' and 'finished' functions, for instance if they don't
* reside in the main .module file. The path should be relative to
* base_path(), and thus should be built using drupal_get_path().
*
* Operations are added as new batch sets. Batch sets are used to ensure
* clean code independence, ensuring that several batches submitted by
@@ -2473,7 +2480,7 @@ function batch_set($batch_definition) {
}

/**
* Process the batch.
* Processes the batch.
*
* Unless the batch has been marked with 'progressive' = FALSE, the function
* issues a drupal_goto and thus ends page execution.
@@ -2540,7 +2547,7 @@ function batch_process($redirect = NULL, $url = NULL) {
}

/**
* Retrieve the current batch.
* Retrieves the current batch.
*/
function &batch_get() {
static $batch = array();

+ 52
- 11
includes/locale.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: locale.inc,v 1.174.2.10 2009/09/15 10:40:26 goba Exp $
// $Id: locale.inc,v 1.174.2.12 2010/03/04 00:15:28 goba Exp $

/**
* @file
@@ -34,6 +34,9 @@ function locale_languages_overview_form() {
$options = array();
$form['weight'] = array('#tree' => TRUE);
foreach ($languages as $langcode => $language) {
// Language code should contain no markup, but is emitted
// by radio and checkbox options.
$langcode = check_plain($langcode);

$options[$langcode] = '';
if ($language->enabled) {
@@ -335,6 +338,17 @@ function locale_languages_predefined_form_submit($form, &$form_state) {
* Validate the language editing form. Reused for custom language addition too.
*/
function locale_languages_edit_form_validate($form, &$form_state) {
// Validate that the name, native, and langcode variables are safe.
if (preg_match('/["<>\']/', $form_state['values']['langcode'])) {
form_set_error('langcode', t('The characters &lt;, &gt;, " and \' are not allowed in the language code field.'));
}
if (preg_match('/["<>\']/', $form_state['values']['name'])) {
form_set_error('name', t('The characters &lt;, &gt;, " and \' are not allowed in the language name in English field.'));
}
if (preg_match('/["<>\']/', $form_state['values']['native'])) {
form_set_error('native', t('The characters &lt;, &gt;, " and \' are not allowed in the native language name field.'));
}

if (!empty($form_state['values']['domain']) && !empty($form_state['values']['prefix'])) {
form_set_error('prefix', t('Domain and path prefix values should not be set at the same time.'));
}
@@ -536,8 +550,13 @@ function locale_translate_seek_screen() {
*/
function locale_translate_seek_form() {
// Get all languages, except English
$languages = locale_language_list('name', TRUE);
unset($languages['en']);
$raw_languages = locale_language_list('name', TRUE);
unset($raw_languages['en']);
// Sanitize the values to be used in radios.
$languages = array();
foreach ($raw_languages as $key => $value) {
$languages[check_plain($key)] = check_plain($value);
}

// Present edit form preserving previous user settings
$query = _locale_translate_seek_query();
@@ -2166,6 +2185,7 @@ function _locale_rebuild_js($langcode = NULL) {
}

// Construct the JavaScript file, if there are translations.
$data_hash = NULL;
$data = $status = '';
if (!empty($translations)) {

@@ -2184,22 +2204,38 @@ function _locale_rebuild_js($langcode = NULL) {
$dir = file_create_path(variable_get('locale_js_directory', 'languages'));

// Delete old file, if we have no translations anymore, or a different file to be saved.
if (!empty($language->javascript) && (!$data || $language->javascript != $data_hash)) {
$changed_hash = $language->javascript != $data_hash;
if (!empty($language->javascript) && (!$data || $changed_hash)) {
file_delete(file_create_path($dir .'/'. $language->language .'_'. $language->javascript .'.js'));
$language->javascript = '';
$status = 'deleted';
}

// Only create a new file if the content has changed.
if ($data && $language->javascript != $data_hash) {
// Only create a new file if the content has changed or the original file got
// lost.
$dest = $dir .'/'. $language->language .'_'. $data_hash .'.js';
if ($data && ($changed_hash || !file_exists($dest))) {
// Ensure that the directory exists and is writable, if possible.
file_check_directory($dir, TRUE);

// Save the file.
$dest = $dir .'/'. $language->language .'_'. $data_hash .'.js';
if (file_save_data($data, $dest)) {
$language->javascript = $data_hash;
$status = ($status == 'deleted') ? 'updated' : 'created';
// If we deleted a previous version of the file and we replace it with a
// new one we have an update.
if ($status == 'deleted') {
$status = 'updated';
}
// If the file did not exist previously and the data has changed we have
// a fresh creation.
elseif ($changed_hash) {
$status = 'created';
}
// If the data hash is unchanged the translation was lost and has to be
// rebuilt.
else {
$status = 'rebuilt';
}
}
else {
$language->javascript = '';
@@ -2207,9 +2243,10 @@ function _locale_rebuild_js($langcode = NULL) {
}
}

// Save the new JavaScript hash (or an empty value if the file
// just got deleted). Act only if some operation was executed.
if ($status) {
// Save the new JavaScript hash (or an empty value if the file just got
// deleted). Act only if some operation was executed that changed the hash
// code.
if ($status && $changed_hash) {
db_query("UPDATE {languages} SET javascript = '%s' WHERE language = '%s'", $language->javascript, $language->language);

// Update the default language variable if the default language has been altered.
@@ -2227,6 +2264,10 @@ function _locale_rebuild_js($langcode = NULL) {
case 'updated':
watchdog('locale', 'Updated JavaScript translation file for the language %language.', array('%language' => t($language->name)));
return TRUE;
case 'rebuilt':
watchdog('locale', 'JavaScript translation file %file.js was lost.', array('%file' => $language->javascript), WATCHDOG_WARNING);
// Proceed to the 'created' case as the JavaScript translation file has
// been created again.
case 'created':
watchdog('locale', 'Created JavaScript translation file for the language %language.', array('%language' => t($language->name)));
return TRUE;

+ 234
- 0
includes/lock.inc View File

@@ -0,0 +1,234 @@
<?php
// $Id: lock.inc,v 1.1.2.2 2010/02/01 16:49:14 goba Exp $

/**
* @file
* A database-mediated implementation of a locking mechanism.
*/

/**
* @defgroup lock Functions to coordinate long-running operations across requests.
* @{
* In most environments, multiple Drupal page requests (a.k.a. threads or
* processes) will execute in parallel. This leads to potential conflicts or
* race conditions when two requests execute the same code at the same time. A
* common example of this is a rebuild like menu_rebuild() where we invoke many
* hook implementations to get and process data from all active modules, and
* then delete the current data in the database to insert the new afterwards.
*
* This is a cooperative, advisory lock system. Any long-running operation
* that could potentially be attempted in parallel by multiple requests should
* try to acquire a lock before proceeding. By obtaiing a lock, one request
* notifies any other requests that a specific opertation is in progress which
* must not be executed in parallel.
*
* To use this API, pick a unique name for the lock. A sensible choice is the
* name of the function performing the operation. A very simple example use of
* this API:
* @code
* function mymodule_long_operation() {
* if (lock_acquire('mymodule_long_operation')) {
* // Do the long operation here.
* // ...
* lock_release('mymodule_long_operation');
* }
* }
* @endcode
*
* If a function acquires a lock it should always release it when the
* operation is complete by calling lock_release(), as in the example.
*
* A function that has acquired a lock may attempt to renew a lock (extend the
* duration of the lock) by calling lock_acquire() again during the operation.
* Failure to renew a lock is indicative that another request has acquired
* the lock, and that the current operation may need to be aborted.
*
* If a function fails to acquire a lock it may either immediately return, or
* it may call lock_wait() if the rest of the current page request requires
* that the operation in question be complete. After lock_wait() returns,
* the function may again attempt to acquire the lock, or may simply allow the
* page request to proceed on the assumption that a parallel request completed
* the operation.
*
* lock_acquire() and lock_wait() will automatically break (delete) a lock
* whose duration has exceeded the timeout specified when it was acquired.
*
* A function that has acquired a lock may attempt to renew a lock (extend the
* duration of the lock) by calling lock_acquire() again during the operation.
* Failure to renew a lock is indicative that another request has acquired
* the lock, and that the current operation may need to be aborted.
*
* Alternative implementations of this API (such as APC) may be substituted
* by setting the 'lock_inc' variable to an alternate include filepath. Since
* this is an API intended to support alternative implementations, code using
* this API should never rely upon specific implementation details (for example
* no code should look for or directly modify a lock in the {semaphore} table).
*/

/**
* Initialize the locking system.
*/
function lock_init() {
global $locks;

$locks = array();
}

/**
* Helper function to get this request's unique id.
*/
function _lock_id() {
static $lock_id;

if (!isset($lock_id)) {
// Assign a unique id.
$lock_id = uniqid(mt_rand(), TRUE);
// We only register a shutdown function if a lock is used.
register_shutdown_function('lock_release_all', $lock_id);
}
return $lock_id;
}

/**
* Acquire (or renew) a lock, but do not block if it fails.
*
* @param $name
* The name of the lock.
* @param $timeout
* A number of seconds (float) before the lock expires.
* @return
* TRUE if the lock was acquired, FALSE if it failed.
*/
function lock_acquire($name, $timeout = 30.0) {
global $locks;

// Insure that the timeout is at least 1 ms.
$timeout = max($timeout, 0.001);
list($usec, $sec) = explode(' ', microtime());
$expire = (float)$usec + (float)$sec + $timeout;
if (isset($locks[$name])) {
// Try to extend the expiration of a lock we already acquired.
if (!db_result(db_query("UPDATE {semaphore} SET expire = %f WHERE name = '%s' AND value = '%s'", $expire, $name, _lock_id()))) {
// The lock was broken.
unset($locks[$name]);
}
}
else {
// Optimistically try to acquire the lock, then retry once if it fails.
// The first time through the loop cannot be a retry.
$retry = FALSE;
// We always want to do this code at least once.
do {
if (@db_query("INSERT INTO {semaphore} (name, value, expire) VALUES ('%s', '%s', %f)", $name, _lock_id(), $expire)) {
// We track all acquired locks in the global variable.
$locks[$name] = TRUE;
// We never need to try again.
$retry = FALSE;
}
else {
// Suppress the error. If this is our first pass through the loop,
// then $retry is FALSE. In this case, the insert must have failed
// meaning some other request acquired the lock but did not release it.
// We decide whether to retry by checking lock_may_be_available()
// Since this will break the lock in case it is expired.
$retry = $retry ? FALSE : lock_may_be_available($name);
}
// We only retry in case the first attempt failed, but we then broke
// an expired lock.
} while ($retry);
}
return isset($locks[$name]);
}

/**
* Check if lock acquired by a different process may be available.
*
* If an existing lock has expired, it is removed.
*
* @param $name
* The name of the lock.
* @return
* TRUE if there is no lock or it was removed, FALSE otherwise.
*/
function lock_may_be_available($name) {
$lock = db_fetch_array(db_query("SELECT expire, value FROM {semaphore} WHERE name = '%s'", $name));
if (!$lock) {
return TRUE;
}
$expire = (float) $lock['expire'];
list($usec, $sec) = explode(' ', microtime());
$now = (float)$usec + (float)$sec;
if ($now > $lock['expire']) {
// We check two conditions to prevent a race condition where another
// request acquired the lock and set a new expire time. We add a small
// number to $expire to avoid errors with float to string conversion.
db_query("DELETE FROM {semaphore} WHERE name = '%s' AND value = '%s' AND expire <= %f", $name, $lock['value'], 0.0001 + $expire);
return (bool)db_affected_rows();
}
return FALSE;
}

/**
* Wait for a lock to be available.
*
* This function may be called in a request that fails to acquire a desired
* lock. This will block further execution until the lock is available or the
* specified delay in seconds is reached. This should not be used with locks
* that are acquired very frequently, since the lock is likely to be acquired
* again by a different request during the sleep().
*
* @param $name
* The name of the lock.
* @param $delay
* The maximum number of seconds to wait, as an integer.
* @return
* TRUE if the lock holds, FALSE if it is available.
*/
function lock_wait($name, $delay = 30) {

while ($delay--) {
// This function should only be called by a request that failed to get a
// lock, so we sleep first to give the parallel request a chance to finish
// and release the lock.
sleep(1);
if (lock_may_be_available($name)) {
// No longer need to wait.
return FALSE;
}
}
// The caller must still wait longer to get the lock.
return TRUE;
}

/**
* Release a lock previously acquired by lock_acquire().
*
* This will release the named lock if it is still held by the current request.
*
* @param $name
* The name of the lock.
*/
function lock_release($name) {
global $locks;

unset($locks[$name]);
db_query("DELETE FROM {semaphore} WHERE name = '%s' AND value = '%s'", $name, _lock_id());
}

/**
* Release all previously acquired locks.
*/
function lock_release_all($lock_id = NULL) {
global $locks;

$locks = array();
if (empty($lock_id)) {
$lock_id = _lock_id();
}

db_query("DELETE FROM {semaphore} WHERE value = '%s'", _lock_id());
}

/**
* @} End of "defgroup locks".
*/

+ 41
- 7
includes/menu.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: menu.inc,v 1.255.2.31 2009/04/27 12:50:13 goba Exp $
// $Id: menu.inc,v 1.255.2.34 2010/02/01 18:00:49 goba Exp $

/**
* @file
@@ -748,13 +748,14 @@ function menu_tree_output($tree) {

$num_items = count($items);
foreach ($items as $i => $data) {
$extra_class = NULL;
$extra_class = array();
if ($i == 0) {
$extra_class = 'first';
$extra_class[] = 'first';
}
if ($i == $num_items - 1) {
$extra_class = 'last';
$extra_class[] = 'last';
}
$extra_class = implode(' ', $extra_class);
$link = theme('menu_item_link', $data['link']);
if ($data['below']) {
$output .= theme('menu_item', $link, $data['link']['has_children'], menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class);
@@ -1503,7 +1504,25 @@ function menu_set_active_item($path) {
}

/**
* Set (or get) the active trail for the current page - the path to root in the menu tree.
* Sets or gets the active trail (path to root menu root) of the current page.
*
* @param $new_trail
* Menu trail to set, or NULL to use previously-set or calculated trail. If
* supplying a trail, use the same format as the return value (see below).
* @return
* Path to menu root of the current page, as an array of menu link items,
* starting with the site's home page. Each link item is an associative array
* with the following components:
* - 'title': Title of the item.
* - 'href': Drupal path of the item.
* - 'localized_options': Options for passing into the l() function.
* - 'type': A menu type constant, such as MENU_DEFAULT_LOCAL_TASK, or 0 to
* indicate it's not really in the menu (used for the home page item).
* If $new_trail is supplied, the value is saved in a static variable and
* returned. If $new_trail is not supplied, and there is a saved value from
* a previous call, the saved value is returned. If $new_trail is not supplied
* and there is no saved value, the path to the current page is calculated,
* saved as the static value, and returned.
*/
function menu_set_active_trail($new_trail = NULL) {
static $trail;
@@ -1566,7 +1585,9 @@ function menu_set_active_trail($new_trail = NULL) {
}

/**
* Get the active trail for the current page - the path to root in the menu tree.
* Gets the active trail (path to root menu root) of the current page.
*
* See menu_set_active_trail() for details of return value.
*/
function menu_get_active_trail() {
return menu_set_active_trail();
@@ -1669,15 +1690,28 @@ function menu_cache_clear_all() {
* is different and leaves stale data in the menu tables.
*/
function menu_rebuild() {
variable_del('menu_rebuild_needed');
if (!lock_acquire('menu_rebuild')) {
// Wait for another request that is already doing this work.
// We choose to block here since otherwise the router item may not
// be avaiable in menu_execute_active_handler() resulting in a 404.
lock_wait('menu_rebuild');
return FALSE;
}

$menu = menu_router_build(TRUE);
_menu_navigation_links_rebuild($menu);
// Clear the menu, page and block caches.
menu_cache_clear_all();
_menu_clear_page_cache();
if (defined('MAINTENANCE_MODE')) {
variable_set('menu_rebuild_needed', TRUE);
}
else {
variable_del('menu_rebuild_needed');
}
lock_release('menu_rebuild');
return TRUE;
}

/**

+ 23
- 11
includes/module.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: module.inc,v 1.115.2.1 2009/02/16 10:32:10 goba Exp $
// $Id: module.inc,v 1.115.2.3 2009/11/16 17:17:35 goba Exp $

/**
* @file
@@ -243,13 +243,25 @@ function module_load_install($module) {

/**
* Load a module include file.
*
* Examples:
* @code
* // Load node.admin.inc from the node module.
* module_load_include('inc', 'node', 'node.admin');
* // Load content_types.inc from the node module.
* module_load_include('inc', 'node', 'content_types');
* @endcode
*
* Do not use this function to load an install file. Use module_load_install()
* instead.
*
* @param $type
* The include file's type (file extension).
* @param $module
* The module to which the include file belongs.
* @param $name
* Optionally, specify the file name. If not set, the module's name is used.
* Optionally, specify the base file name (without the $type extension).
* If not set, $module is used.
*/
function module_load_include($type, $module, $name = NULL) {
if (empty($name)) {
@@ -356,19 +368,19 @@ function module_disable($module_list) {
* Allow modules to interact with the Drupal core.
*
* Drupal's module system is based on the concept of "hooks". A hook is a PHP
* function that is named foo_bar(), where "foo" is the name of the module (whose
* filename is thus foo.module) and "bar" is the name of the hook. Each hook has
* a defined set of parameters and a specified result type.
* function that is named foo_bar(), where "foo" is the name of the module
* (whose filename is thus foo.module) and "bar" is the name of the hook. Each
* hook has a defined set of parameters and a specified result type.
*
* To extend Drupal, a module need simply implement a hook. When Drupal wishes to
* allow intervention from modules, it determines which modules implement a hook
* and call that hook in all enabled modules that implement it.
* To extend Drupal, a module need simply implement a hook. When Drupal wishes
* to allow intervention from modules, it determines which modules implement a
* hook and calls that hook in all enabled modules that implement it.
*
* The available hooks to implement are explained here in the Hooks section of
* the developer documentation. The string "hook" is used as a placeholder for
* the module name is the hook definitions. For example, if the module file is
* called example.module, then hook_help() as implemented by that module would be
* defined as example_help().
* the module name in the hook definitions. For example, if the module file is
* called example.module, then hook_help() as implemented by that module would
* be defined as example_help().
*/

/**

+ 4
- 4
includes/path.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: path.inc,v 1.19.2.1 2008/10/13 21:06:41 dries Exp $
// $Id: path.inc,v 1.19.2.3 2010/03/01 09:19:15 goba Exp $

/**
* @file
@@ -66,7 +66,7 @@ function drupal_lookup_path($action, $path = '', $path_language = '') {
return $map[$path_language][$path];
}
// Get the most fitting result falling back with alias without language
$alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s' AND language IN('%s', '') ORDER BY language DESC", $path, $path_language));
$alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s' AND language IN('%s', '') ORDER BY language DESC, pid DESC", $path, $path_language));
$map[$path_language][$path] = $alias;
return $alias;
}
@@ -77,7 +77,7 @@ function drupal_lookup_path($action, $path = '', $path_language = '') {
$src = '';
if (!isset($map[$path_language]) || !($src = array_search($path, $map[$path_language]))) {
// Get the most fitting result falling back with alias without language
if ($src = db_result(db_query("SELECT src FROM {url_alias} WHERE dst = '%s' AND language IN('%s', '') ORDER BY language DESC", $path, $path_language))) {
if ($src = db_result(db_query("SELECT src FROM {url_alias} WHERE dst = '%s' AND language IN('%s', '') ORDER BY language DESC, pid DESC", $path, $path_language))) {
$map[$path_language][$src] = $path;
}
else {
@@ -231,7 +231,7 @@ function drupal_is_front_page() {
* String containing a set of patterns separated by \n, \r or \r\n.
*
* @return
* Boolean value: TRUE if the path matches a pattern, FALSE otherwise.
* 1 if there is a match, 0 if there is not a match.
*/
function drupal_match_path($path, $patterns) {
static $regexps;

+ 6
- 4
includes/session.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: session.inc,v 1.44.2.6 2008/12/11 00:29:34 goba Exp $
// $Id: session.inc,v 1.44.2.7 2010/03/04 00:15:28 goba Exp $

/**
* @file
@@ -31,8 +31,9 @@ function sess_read($key) {
// Otherwise, if the session is still active, we have a record of the client's session in the database.
$user = db_fetch_object(db_query("SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = '%s'", $key));

// We found the client's session record and they are an authenticated user
if ($user && $user->uid > 0) {
// We found the client's session record and they are an authenticated,
// active user.
if ($user && $user->uid > 0 && $user->status == 1) {
// This is done to unserialize the data member of $user
$user = drupal_unpack($user);

@@ -44,7 +45,8 @@ function sess_read($key) {
$user->roles[$role->rid] = $role->name;
}
}
// We didn't find the client's record (session has expired), or they are an anonymous user.
// We didn't find the client's record (session has expired), or they are
// blocked, or they are an anonymous user.
else {
$session = isset($user->session) ? $user->session : '';
$user = drupal_anonymous_user($session);

+ 55
- 9
includes/theme.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: theme.inc,v 1.415.2.24 2009/06/18 12:04:04 goba Exp $
// $Id: theme.inc,v 1.415.2.27 2010/03/01 10:02:01 goba Exp $

/**
* @file
@@ -273,19 +273,41 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
if (!isset($info['template']) && !isset($info['function'])) {
$result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name .'_') . $hook;
}

// Make sure include files is set so we don't generate notices later.
if (!isset($info['include files'])) {
$result[$hook]['include files'] = array();
}

// If a path is set in the info, use what was set. Otherwise use the
// default path. This is mostly so system.module can declare theme
// functions on behalf of core .include files.
// All files are included to be safe. Conditionally included
// files can prevent them from getting registered.
if (isset($info['file']) && !isset($info['path'])) {
$result[$hook]['file'] = $path .'/'. $info['file'];
include_once($result[$hook]['file']);
// First, check to see if the fully qualified file exists.
$filename = './'. $path .'/'. $info['file'];
if (file_exists($filename)) {
require_once $filename;
$result[$hook]['include files'][] = $filename;
}
else {
$filename = './'. $info['file'];
if (file_exists($filename)) {
require_once $filename;
$result[$hook]['include files'][] = $filename;
}
}
}
elseif (isset($info['file']) && isset($info['path'])) {
include_once($info['path'] .'/'. $info['file']);
$filename = './'. $info['path'] .'/'. $info['file'];
if (file_exists($filename)) {
require_once $filename;
$result[$hook]['include files'][] = $filename;
}
}


if (isset($info['template']) && !isset($info['path'])) {
$result[$hook]['template'] = $path .'/'. $info['template'];
}
@@ -605,13 +627,30 @@ function theme() {
$theme_path = $hooks[$hook]['theme path'];

// Include a file if the theme function or preprocess function is held elsewhere.
if (!empty($info['include files'])) {
foreach ($info['include files'] as $include_file) {
include_once($include_file);
}
}

// Handle compatibility with theme_registry_alters to prevent failures.
if (!empty($info['file'])) {
static $included_files = array();
$include_file = $info['file'];
if (isset($info['path'])) {
if (!empty($info['path'])) {
$include_file = $info['path'] .'/'. $include_file;
}
include_once($include_file);

if (empty($included_files[$include_file])) {
// Statically cache files we've already tried to include so we don't
// run unnecessary file_exists calls.
$included_files[$include_file] = TRUE;
if (file_exists('./'. $include_file)) {
include_once('./'. $include_file);
}
}
}

if (isset($info['function'])) {
// The theme call is a function.
$output = call_user_func_array($info['function'], $args);
@@ -768,13 +807,16 @@ function drupal_find_theme_functions($cache, $prefixes) {
'function' => $match,
'arguments' => $info['arguments'],
'original hook' => $hook,
'include files' => $info['include files'],
);
}
}
}

if (function_exists($prefix .'_'. $hook)) {
$templates[$hook] = array(
'function' => $prefix .'_'. $hook,
'include files' => $info['include files'],
);
// Ensure that the pattern is maintained from base themes to its sub-themes.
// Each sub-theme will have their functions scanned so the pattern must be
@@ -782,6 +824,8 @@ function drupal_find_theme_functions($cache, $prefixes) {
if (isset($info['pattern'])) {
$templates[$hook]['pattern'] = $info['pattern'];
}
// Also ensure that the 'file' property is maintained, because it probably
// contains the preprocess.
}
}
}
@@ -845,6 +889,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$templates[$hook] = array(
'template' => $template,
'path' => dirname($file->filename),
'include files' => $cache[$hook]['include files'],
);
}
// Ensure that the pattern is maintained from base themes to its sub-themes.
@@ -873,6 +918,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
'path' => dirname($files[$match]->filename),
'arguments' => $info['arguments'],
'original hook' => $hook,
'include files' => $info['include files'],
);
}
}
@@ -1274,7 +1320,7 @@ function theme_submenu($links) {
* - Any HTML attributes, such as "colspan", to apply to the table cell.
*
* Here's an example for $rows:
* @verbatim
* @code
* $rows = array(
* // Simple row
* array(
@@ -1285,7 +1331,7 @@ function theme_submenu($links) {
* 'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => 'funky'
* )
* );
* @endverbatim
* @endcode
*
* @param $attributes
* An array of HTML attributes to apply to the table tag.
@@ -1313,7 +1359,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
// Format the table header:
if (count($header)) {
$ts = tablesort_init($header);
// HTML requires that the thead tag has tr tags in it follwed by tbody
// HTML requires that the thead tag has tr tags in it followed by tbody
// tags. Using ternary operator to check and see if we have any rows.
$output .= (count($rows) ? ' <thead><tr>' : ' <tr>');
foreach ($header as $cell) {

+ 3
- 3
includes/theme.maintenance.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: theme.maintenance.inc,v 1.10.2.1 2009/08/10 11:11:59 goba Exp $
// $Id: theme.maintenance.inc,v 1.10.2.2 2010/03/04 00:15:28 goba Exp $

/**
* @file
@@ -125,9 +125,9 @@ function theme_install_page($content) {
$title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process');
$variables['messages'] .= '<h3>'. $title .':</h3>';
$variables['messages'] .= theme('status_messages', 'error');
$variables['content'] .= '<p>'. st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) .'</p>';
$variables['content'] .= '<p>'. st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => check_url(request_uri()))) .'</p>';
}
// Special handling of warning messages
if (isset($messages['warning'])) {
$title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');

+ 5
- 2
includes/xmlrpcs.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: xmlrpcs.inc,v 1.24.2.1 2008/04/28 10:04:52 dries Exp $
// $Id: xmlrpcs.inc,v 1.24.2.3 2009/12/07 11:36:28 goba Exp $

/**
* The main entry point for XML-RPC requests.
@@ -64,10 +64,13 @@ function xmlrpc_server($callbacks) {
if ($xmlrpc_server->message->messagetype != 'methodCall') {
xmlrpc_server_error(-32600, t('Server error. Invalid XML-RPC. Request must be a methodCall.'));
}
if (!isset($xmlrpc_server->message->params)) {
$xmlrpc_server->message->params = array();
}
xmlrpc_server_set($xmlrpc_server);
$result = xmlrpc_server_call($xmlrpc_server, $xmlrpc_server->message->methodname, $xmlrpc_server->message->params);

if ($result->is_error) {
if (is_object($result) && !empty($result->is_error)) {
xmlrpc_server_error($result);
}
// Encode the result

+ 16
- 10
install.php View File

@@ -1,5 +1,5 @@
<?php
// $Id: install.php,v 1.113.2.9 2009/04/27 10:50:35 goba Exp $
// $Id: install.php,v 1.113.2.10 2010/03/01 09:36:01 goba Exp $

require_once './includes/install.inc';

@@ -40,6 +40,13 @@ function install_main() {
drupal_load('module', 'system');
drupal_load('module', 'filter');

// Install profile chosen, set the global immediately.
// This needs to be done before the theme cache gets
// initialized in drupal_maintenance_theme().
if (!empty($_GET['profile'])) {
$profile = preg_replace('/[^a-zA-Z_0-9]/', '', $_GET['profile']);
}

// Set up theme system for the maintenance page.
drupal_maintenance_theme();

@@ -74,15 +81,14 @@ function install_main() {
$task = NULL;
}

// Decide which profile to use.
if (!empty($_GET['profile'])) {
$profile = preg_replace('/[^a-zA-Z_0-9]/', '', $_GET['profile']);
}
elseif ($profile = install_select_profile()) {
install_goto("install.php?profile=$profile");
}
else {
install_no_profile_error();
// No profile was passed in GET, ask the user.
if (empty($_GET['profile'])) {
if ($profile = install_select_profile()) {
install_goto("install.php?profile=$profile");
}
else {
install_no_profile_error();
}
}

// Load the profile.

+ 2
- 2
misc/teaser.js View File

@@ -1,4 +1,4 @@
// $Id: teaser.js,v 1.12.2.1 2009/05/20 11:50:54 goba Exp $
// $Id: teaser.js,v 1.12.2.2 2010/03/01 10:13:18 goba Exp $

/**
* Auto-attach for teaser behavior.
@@ -88,7 +88,7 @@ Drupal.behaviors.teaser = function(context) {
Drupal.behaviors.textarea(teaser.parentNode);
}
// Set initial visibility
if ($(teaser).is('[@disabled]')) {
if ($(teaser).is(':disabled')) {
$(teaser).parent().hide();
}


+ 3
- 3
modules/aggregator/aggregator.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 3
- 3
modules/block/block.info View File

@@ -5,8 +5,8 @@ package = Core - required
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 27
- 1
modules/block/block.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: block.module,v 1.299.2.3 2008/06/24 14:40:08 goba Exp $
// $Id: block.module,v 1.299.2.4 2009/10/06 12:13:01 goba Exp $

/**
* @file
@@ -298,6 +298,19 @@ function _block_rehash() {
return $blocks;
}

/**
* Returns information from database about a user-created (custom) block.
*
* @param $bid
* ID of the block to get information for.
* @return
* Associative array of information stored in the database for this block.
* Array keys:
* - bid: Block ID.
* - info: Block description.
* - body: Block contents.
* - format: Filter ID of the filter format for the body.
*/
function block_box_get($bid) {
return db_fetch_array(db_query("SELECT * FROM {boxes} WHERE bid = %d", $bid));
}
@@ -336,6 +349,19 @@ function block_box_form($edit = array()) {
return $form;
}

/**
* Saves a user-created block in the database.
*
* @param $edit
* Associative array of fields to save. Array keys:
* - info: Block description.
* - body: Block contents.
* - format: Filter ID of the filter format for the body.
* @param $delta
* Block ID of the block to save.
* @return
* Always returns TRUE.
*/
function block_box_save($edit, $delta) {
if (!filter_access($edit['format'])) {
$edit['format'] = FILTER_FORMAT_DEFAULT;

+ 3
- 3
modules/blog/blog.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 3
- 3
modules/blogapi/blogapi.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 3
- 3
modules/book/book.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 3
- 3
modules/color/color.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 2
- 3
modules/comment/comment.admin.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: comment.admin.inc,v 1.4.2.2 2008/05/19 07:27:35 goba Exp $
// $Id: comment.admin.inc,v 1.4.2.3 2010/01/28 10:15:11 goba Exp $

/**
* @file
@@ -84,7 +84,6 @@ function comment_admin_overview_validate($form, &$form_state) {
$form_state['values']['comments'] = array_diff($form_state['values']['comments'], array(0));
if (count($form_state['values']['comments']) == 0) {
form_set_error('', t('Please select one or more comments to perform the update on.'));
drupal_goto('admin/content/comment');
}
}

@@ -96,7 +95,7 @@ function comment_admin_overview_validate($form, &$form_state) {
*/
function comment_admin_overview_submit($form, &$form_state) {
$operations = comment_operations();
if ($operations[$form_state['values']['operation']][1]) {
if (!empty($operations[$form_state['values']['operation']][1])) {
// extract the appropriate database query operation
$query = $operations[$form_state['values']['operation']][1];
foreach ($form_state['values']['comments'] as $cid => $value) {

+ 3
- 3
modules/comment/comment.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 19
- 11
modules/comment/comment.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: comment.module,v 1.617.2.10 2009/09/14 10:36:42 goba Exp $
// $Id: comment.module,v 1.617.2.14 2010/03/01 09:44:31 goba Exp $

/**
* @file
@@ -363,13 +363,13 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
// Threaded comments. See the documentation for comment_render().
if ($order == COMMENT_ORDER_NEWEST_FIRST) {
// Newest first: find the last thread with new comment
$result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY thread DESC LIMIT 1', $node->nid, $new_replies);
$result = db_query('SELECT thread FROM (SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) AS thread ORDER BY thread DESC LIMIT 1', $node->nid, $new_replies);
$thread = db_result($result);
$result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '". $thread ."'", $node->nid);
}
else {
// Oldest first: find the first thread with new comment
$result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $node->nid, $new_replies);
$result = db_query('SELECT thread FROM (SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) AS thread ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $node->nid, $new_replies);
$thread = substr(db_result($result), 0, -1);
$result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '". $thread ."'", $node->nid);
}
@@ -1072,20 +1072,20 @@ function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
'delete' => array(t('Delete the selected comments'), ''),
);
}
else if ($action == 'unpublish') {
$operations = array(
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
'delete' => array(t('Delete the selected comments'), ''),
);
}
else {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
'delete' => array(t('Delete the selected comments'), ''),
);
}
return $operations;
@@ -1550,16 +1550,20 @@ function comment_form_submit($form, &$form_state) {
}

/**
* Theme a single comment block.
* Themes a single comment and related items.
*
* @param $comment
* The comment object.
* @param $node
* The comment node.
* @param $links
* An associative array containing control links.
* An associative array containing control links suitable for passing into
* theme_links(). These are generated by modules implementing hook_link() with
* $type='comment'. Typical examples are links for editing and deleting
* comments.
* @param $visible
* Switches between folded/unfolded view.
* Switches between folded/unfolded view. If TRUE the comments are visible, if
* FALSE the comments are folded.
* @ingroup themeable
*/
function theme_comment_view($comment, $node, $links = array(), $visible = TRUE) {
@@ -1739,7 +1743,9 @@ function theme_comment_flat_collapsed($comment, $node) {
* @ingroup themeable
*/
function theme_comment_flat_expanded($comment, $node) {
return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
$links = module_invoke_all('link', 'comment', $comment, 0);
drupal_alter('link', $links, $node);
return theme('comment_view', $comment, $node, $links);
}

/**
@@ -1765,7 +1771,9 @@ function theme_comment_thread_collapsed($comment, $node) {
* @ingroup themeable
*/
function theme_comment_thread_expanded($comment, $node) {
return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
$links = module_invoke_all('link', 'comment', $comment, 0);
drupal_alter('link', $links, $node);
return theme('comment_view', $comment, $node, $links);
}

/**

+ 2
- 2
modules/contact/contact.admin.inc View File

@@ -1,5 +1,5 @@
<?php
// $Id: contact.admin.inc,v 1.3 2007/11/09 07:55:13 dries Exp $
// $Id: contact.admin.inc,v 1.3.2.1 2009/12/16 20:47:10 goba Exp $

/**
* @file
@@ -13,7 +13,7 @@ function contact_admin_categories() {
$result = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category');
$rows = array();
while ($category = db_fetch_object($result)) {
$rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/build/contact/edit/'. $category->cid), l(t('delete'), 'admin/build/contact/delete/'. $category->cid));
$rows[] = array(check_plain($category->category), check_plain($category->recipients), ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/build/contact/edit/'. $category->cid), l(t('delete'), 'admin/build/contact/delete/'. $category->cid));
}
$header = array(t('Category'), t('Recipients'), t('Selected'), array('data' => t('Operations'), 'colspan' => 2));


+ 3
- 3
modules/contact/contact.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 30
- 10
modules/contact/contact.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: contact.module,v 1.103.2.1 2008/04/09 21:11:46 goba Exp $
// $Id: contact.module,v 1.103.2.2 2009/11/06 07:36:34 goba Exp $

/**
* @file
@@ -110,19 +110,39 @@ function contact_menu() {
}

/**
* Determine if a user can access to the contact tab.
* Menu access callback for a user's personal contact form.
*
* @param $account
* A user account object.
* @return
* TRUE if the current user has access to the requested user's contact form,
* or FALSE otherwise.
*/
function _contact_user_tab_access($account) {
global $user;
if (!isset($account->contact)) {
$account->contact = FALSE;

// Anonymous users cannot use or have contact forms.
if (!$user->uid || !$account->uid) {
return FALSE;
}
return
$account && $user->uid &&
(
($user->uid != $account->uid && $account->contact) ||
user_access('administer users')
);

// User administrators should always have access to personal contact forms.
if (user_access('administer users')) {
return TRUE;
}

// Users may not contact themselves.
if ($user->uid == $account->uid) {
return FALSE;
}

// If the requested user has disabled their contact form, or this preference
// has not yet been saved, do not allow users to contact them.
if (empty($account->contact)) {
return FALSE;
}

return TRUE;
}

/**

+ 3
- 3
modules/dblog/dblog.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 4
- 1
modules/dblog/dblog.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: dblog.module,v 1.21.2.2 2008/04/09 21:11:46 goba Exp $
// $Id: dblog.module,v 1.21.2.3 2010/03/01 10:26:48 goba Exp $

/**
* @file
@@ -126,6 +126,9 @@ function _dblog_get_message_types() {
return $types;
}

/**
* Implementation of hook_watchdog().
*/
function dblog_watchdog($log = array()) {
$current_db = db_set_active();
db_query("INSERT INTO {watchdog}

+ 3
- 3
modules/filter/filter.info View File

@@ -5,8 +5,8 @@ package = Core - required
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 2
- 2
modules/filter/filter.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: filter.module,v 1.204.2.9 2009/08/10 11:04:37 goba Exp $
// $Id: filter.module,v 1.204.2.10 2010/03/01 10:54:29 goba Exp $

/**
* @file
@@ -912,10 +912,10 @@ function _filter_autop($text) {
$chunk = preg_replace('!(</'. $block .'>)!', "$1\n\n", $chunk); // Space things out a little
$chunk = preg_replace("/\n\n+/", "\n\n", $chunk); // take care of duplicates
$chunk = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $chunk); // make paragraphs, including one at the end
$chunk = preg_replace('|<p>\s*</p>\n|', '', $chunk); // under certain strange conditions it could create a P of entirely whitespace
$chunk = preg_replace("|<p>(<li.+?)</p>|", "$1", $chunk); // problem with nested lists
$chunk = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $chunk);
$chunk = str_replace('</blockquote></p>', '</p></blockquote>', $chunk);
$chunk = preg_replace('|<p>\s*</p>\n?|', '', $chunk); // under certain strange conditions it could create a P of entirely whitespace
$chunk = preg_replace('!<p>\s*(</?'. $block .'[^>]*>)!', "$1", $chunk);
$chunk = preg_replace('!(</?'. $block .'[^>]*>)\s*</p>!', "$1", $chunk);
$chunk = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $chunk); // make line breaks

+ 3
- 3
modules/forum/forum.info View File

@@ -7,8 +7,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 2
- 2
modules/forum/forum.module View File

@@ -1,5 +1,5 @@
<?php
// $Id: forum.module,v 1.448.2.7 2009/06/03 18:27:48 goba Exp $
// $Id: forum.module,v 1.448.2.8 2010/03/01 11:32:00 goba Exp $

/**
* @file
@@ -392,7 +392,7 @@ function forum_form_alter(&$form, $form_state, $form_id) {
* Implementation of hook_load().
*/
function forum_load($node) {
$forum = db_fetch_object(db_query('SELECT * FROM {term_node} WHERE vid = %d', $node->vid));
$forum = db_fetch_object(db_query('SELECT * FROM {forum} WHERE vid = %d', $node->vid));

return $forum;
}

+ 3
- 3
modules/help/help.info View File

@@ -5,8 +5,8 @@ package = Core - optional
version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-09-16
version = "6.14"
; Information added by drupal.org packaging script on 2010-03-04
version = "6.16"
project = "drupal"
datestamp = "1253130027"
datestamp = "1267662008"


+ 3
- 3
modules/locale/locale.info