aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_comment.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_comment.inc.php')
-rw-r--r--include/functions_comment.inc.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php
index 67716216c..b388439f5 100644
--- a/include/functions_comment.inc.php
+++ b/include/functions_comment.inc.php
@@ -309,7 +309,7 @@ $user_where_clause.'
function update_user_comment($comment, $post_key)
{
- global $conf;
+ global $conf, $page;
$comment_action = 'validate';
@@ -335,6 +335,20 @@ function update_user_comment($comment, $post_key)
)
);
+ // website
+ if (!empty($comment['website_url']))
+ {
+ if (!preg_match('/^https?/i', $comment['website_url']))
+ {
+ $comment['website_url'] = 'http://'.$comment['website_url'];
+ }
+ if (!url_check_format($comment['website_url']))
+ {
+ array_push($page['errors'], l10n('Your website URL is invalid'));
+ $comment_action='reject';
+ }
+ }
+
if ( $comment_action!='reject' )
{
$user_where_clause = '';
@@ -347,6 +361,7 @@ function update_user_comment($comment, $post_key)
$query = '
UPDATE '.COMMENTS_TABLE.'
SET content = \''.$comment['content'].'\',
+ website_url = '.(!empty($comment['website_url']) ? '\''.$comment['website_url'].'\'' : 'NULL').',
validated = \''.($comment_action=='validate' ? 'true':'false').'\',
validation_date = '.($comment_action=='validate' ? 'NOW()':'NULL').'
WHERE id = '.$comment['comment_id'].