diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-10 18:00:37 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-10 18:00:37 +0000 |
commit | 84bad295166f38171a488c524d62e3d6ce9bfd72 (patch) | |
tree | 031730143c8e58774faae30608d9c26f43365d0b | |
parent | 9adf9d8ce423b582ccabde5786177ff329d2c818 (diff) | |
download | brdo-84bad295166f38171a488c524d62e3d6ce9bfd72.tar.gz brdo-84bad295166f38171a488c524d62e3d6ce9bfd72.tar.bz2 |
#72865 by AjK, use more standard is_numeric() instead of ctype_digit().
-rw-r--r-- | modules/comment.module | 8 | ||||
-rw-r--r-- | modules/comment/comment.module | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/comment.module b/modules/comment.module index 0d40b2d9c..51ed7104a 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -924,7 +924,7 @@ function comment_delete($cid) { // We'll only delete if the user has confirmed the // deletion using the form in our else clause below. - if (is_object($comment) && ctype_digit($comment->cid) && $_POST['edit']['confirm']) { + if (is_object($comment) && is_numeric($comment->cid) && $_POST['edit']['confirm']) { drupal_set_message(t('The comment and all its replies have been deleted.')); // Delete comment and its replies. @@ -937,7 +937,7 @@ function comment_delete($cid) { drupal_goto("node/$comment->nid"); } - else if (is_object($comment) && ctype_digit($comment->cid)) { + else if (is_object($comment) && is_numeric($comment->cid)) { $output = confirm_form('comment_confirm_delete', array(), t('Are you sure you want to delete the comment %title?', array('%title' => theme('placeholder', $comment->subject))), @@ -1105,7 +1105,7 @@ function comment_multiple_delete_confirm() { $comment_counter = 0; foreach (array_filter($edit['comments']) as $cid => $value) { $comment = _comment_load($cid); - if (is_object($comment) && ctype_digit($comment->cid)) { + if (is_object($comment) && is_numeric($comment->cid)) { $subject = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid)); $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '<li>', '#suffix' => check_plain($subject) .'</li>'); $comment_counter++; @@ -1657,7 +1657,7 @@ function theme_comment_post_forbidden($nid) { } function _comment_delete_thread($comment) { - if (!is_object($comment) || !ctype_digit($comment->cid)) { + if (!is_object($comment) || !is_numeric($comment->cid)) { watchdog('content', t('Can not delete non-existent comment.'), WATCHDOG_WARNING); return; } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 0d40b2d9c..51ed7104a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -924,7 +924,7 @@ function comment_delete($cid) { // We'll only delete if the user has confirmed the // deletion using the form in our else clause below. - if (is_object($comment) && ctype_digit($comment->cid) && $_POST['edit']['confirm']) { + if (is_object($comment) && is_numeric($comment->cid) && $_POST['edit']['confirm']) { drupal_set_message(t('The comment and all its replies have been deleted.')); // Delete comment and its replies. @@ -937,7 +937,7 @@ function comment_delete($cid) { drupal_goto("node/$comment->nid"); } - else if (is_object($comment) && ctype_digit($comment->cid)) { + else if (is_object($comment) && is_numeric($comment->cid)) { $output = confirm_form('comment_confirm_delete', array(), t('Are you sure you want to delete the comment %title?', array('%title' => theme('placeholder', $comment->subject))), @@ -1105,7 +1105,7 @@ function comment_multiple_delete_confirm() { $comment_counter = 0; foreach (array_filter($edit['comments']) as $cid => $value) { $comment = _comment_load($cid); - if (is_object($comment) && ctype_digit($comment->cid)) { + if (is_object($comment) && is_numeric($comment->cid)) { $subject = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid)); $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '<li>', '#suffix' => check_plain($subject) .'</li>'); $comment_counter++; @@ -1657,7 +1657,7 @@ function theme_comment_post_forbidden($nid) { } function _comment_delete_thread($comment) { - if (!is_object($comment) || !ctype_digit($comment->cid)) { + if (!is_object($comment) || !is_numeric($comment->cid)) { watchdog('content', t('Can not delete non-existent comment.'), WATCHDOG_WARNING); return; } |