Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ function check_plain($text) {
// @todo remove this when support for either IE6 or PHP < 5.2.5 is dropped.

if ($php525) {
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
return htmlspecialchars((string) $text, ENT_QUOTES, 'UTF-8');
}
return (preg_match('/^./us', $text) == 1) ? htmlspecialchars($text, ENT_QUOTES, 'UTF-8') : '';
}
Expand Down Expand Up @@ -899,7 +899,7 @@ function check_plain($text) {
* TRUE if the text is valid UTF-8, FALSE if not.
*/
function drupal_validate_utf8($text) {
if (strlen($text) == 0) {
if (strlen((string) $text) == 0) {
return TRUE;
}
// For performance reasons this logic is duplicated in check_plain().
Expand Down
4 changes: 4 additions & 0 deletions includes/file.inc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<IfModule mod_php7.c>
php_flag engine off
</IfModule>
# From PHP 8 there is no number in the module name.
<IfModule mod_php.c>
php_flag engine off
</IfModule>
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_flag engine off
Expand Down
2 changes: 1 addition & 1 deletion includes/locale.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ function _locale_parse_js_file($filepath) {
if ($source = db_fetch_object($result)) {
// We already have this source string and now have to add the location
// to the location column, if this file is not yet present in there.
$locations = preg_split('~\s*;\s*~', $source->location);
$locations = preg_split('~\s*;\s*~', (string) $source->location);

if (!in_array($filepath, $locations)) {
$locations[] = $filepath;
Expand Down
2 changes: 1 addition & 1 deletion modules/filter/filter.module
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite',
// Store the input format
_filter_xss_split($allowed_tags, TRUE);
// Remove NUL characters (ignored by some browsers)
$string = str_replace(chr(0), '', $string);
$string = str_replace(chr(0), '', (string) $string);
// Remove Netscape 4 JS entities
$string = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);

Expand Down
4 changes: 4 additions & 0 deletions modules/system/system.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,10 @@ function system_status($check = FALSE) {
* Menu callback: run cron manually.
*/
function system_run_cron() {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'run-cron')) {
return MENU_ACCESS_DENIED;
}

// Run cron manually
if (drupal_cron_run()) {
drupal_set_message(t('Cron ran successfully.'));
Expand Down
2 changes: 1 addition & 1 deletion modules/system/system.install
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function system_requirements($phase) {
'title' => $t('Cron maintenance tasks'),
'severity' => $severity,
'value' => $summary,
'description' => $description .' '. $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron'))),
'description' => $description .' '. $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron', array('query' => array('token' => drupal_get_token('run-cron')))))),
);
}

Expand Down
3 changes: 2 additions & 1 deletion modules/update/update.module
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ function update_form_alter(&$form, $form_state, $form_id) {
*/
function _update_no_data() {
$destination = drupal_get_destination();
$cron_token = array('token' => drupal_get_token('run-cron'));
return t('No information is available about potential new releases for currently installed modules and themes. To check for updates, you may need to <a href="@run_cron">run cron</a> or you can <a href="@check_manually">check manually</a>. Please note that checking for available updates can take a long time, so please be patient.', array(
'@run_cron' => url('admin/reports/status/run-cron', array('query' => $destination)),
'@run_cron' => url('admin/reports/status/run-cron', array('query' => $cron_token + $destination)),
'@check_manually' => url('admin/reports/updates/check', array('query' => $destination)),
));
}
Expand Down