summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator/aggregator.module8
-rw-r--r--modules/comment/comment.module3
-rw-r--r--modules/filter/filter.module9
-rw-r--r--modules/node/node.module4
-rw-r--r--modules/openid/openid.inc18
5 files changed, 10 insertions, 32 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 104e2146e..d918022ec 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -695,9 +695,7 @@ function aggregator_refresh($feed) {
}
if (!empty($image['LINK']) && !empty($image['URL']) && !empty($image['TITLE'])) {
- // TODO: we should really use theme_image() here, but that only works with
- // local images. It won't work with images fetched with a URL unless PHP version > 5.
- $image = '<a href="' . check_url($image['LINK']) . '" class="feed-image"><img src="' . check_url($image['URL']) . '" alt="' . check_plain($image['TITLE']) . '" /></a>';
+ $image = l(theme('image', $image['URL'], $image['TITLE']), $image['LINK'], array('html' => TRUE));
}
else {
$image = '';
@@ -864,9 +862,9 @@ function aggregator_parse_feed(&$data, $feed) {
}
}
- $timestamp = strtotime($date); // As of PHP 5.1.0, strtotime returns FALSE on failure instead of -1.
+ $timestamp = strtotime($date);
- if ($timestamp <= 0) {
+ if ($timestamp === FALSE) {
$timestamp = aggregator_parse_w3cdtf($date); // Aggregator_parse_w3cdtf() returns FALSE on failure.
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 341767aa3..7644e0f9e 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1134,8 +1134,7 @@ function comment_validate($edit) {
comment_invoke_comment($edit, 'validate');
if (isset($edit['date'])) {
- // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1.
- if (strtotime($edit['date']) <= 0) {
+ if (strtotime($edit['date']) === FALSE) {
form_set_error('date', t('You have to specify a valid date.'));
}
}
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 39c905189..8366216b4 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -977,7 +977,7 @@ function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite',
/**
* Processes an HTML tag.
*
- * @param @m
+ * @param $m
* An array with various meaning depending on the value of $store.
* If $store is TRUE then the array contains the allowed tags.
* If $store is FALSE then the array has one element, the HTML tag to process.
@@ -1025,10 +1025,9 @@ function _filter_xss_split($m, $store = FALSE) {
}
// Is there a closing XHTML slash at the end of the attributes?
- // In PHP 5.1.0+ we could count the changes, currently we need a separate match
- $xhtml_slash = preg_match('%\s?/\s*$%', $attrlist) ? ' /' : '';
- $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist);
-
+ $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist, -1, $count);
+ $xhtml_slash = $count ? ' /' : '';
+
// Clean up attributes
$attr2 = implode(' ', _filter_xss_attributes($attrlist));
$attr2 = preg_replace('/[<>]/', '', $attr2);
diff --git a/modules/node/node.module b/modules/node/node.module
index 2101c671e..5c4bc884a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -842,8 +842,8 @@ function node_validate($node, $form = array()) {
form_set_error('name', t('The username %name does not exist.', array('%name' => $node->name)));
}
- // Validate the "authored on" field. As of PHP 5.1.0, strtotime returns FALSE instead of -1 upon failure.
- if (!empty($node->date) && strtotime($node->date) <= 0) {
+ // Validate the "authored on" field.
+ if (!empty($node->date) && strtotime($node->date) === FALSE) {
form_set_error('date', t('You have to specify a valid date.'));
}
}
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index a6d369067..959a95a9f 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -446,21 +446,3 @@ function _openid_get_params($str) {
}
return $data;
}
-
-/**
- * Provide bcpowmod support for PHP4.
- */
-if (!function_exists('bcpowmod')) {
- function bcpowmod($base, $exp, $mod) {
- $square = bcmod($base, $mod);
- $result = 1;
- while (bccomp($exp, 0) > 0) {
- if (bcmod($exp, 2)) {
- $result = bcmod(bcmul($result, $square), $mod);
- }
- $square = bcmod(bcmul($square, $square), $mod);
- $exp = bcdiv($exp, 2);
- }
- return $result;
- }
-}