mercredi 10 septembre 2014

Protection links in comments DLE English

Protection links in comments DLE English
Hack Protection links in comments DLE
After applying this hack if a user leaves a comment with a link, the comment will be sent for moderation with proper notification user, otherwise it will be added soon. For moderation will not go away on users with 1-3 groups (administrators, editors and journalists).

Installation:
1 Open File engine/modules/addcomments.php and find:
 
if( $update_comments ) {
$comments = $db->safesql( $row['text'] ) . "<br /><br />" . $db->safesql( $comments );

....


Add above:
 
if( preg_match ("/href|url|http|www|\.ru|\.com|\.net|\.info|\.org|\.ua/i", $comments) AND ($member_id['user_group'] > 3) ) {
if( $update_comments ) {
if( $row['approve'] ) $update_comments = false;
}
$where_approve = 0;
$stop[] = $lang['news_err_31'];
$CN_HALT = TRUE;
msgbox( $lang['all_info'], implode( "<br />", $stop ) . "<br /><br /><a href=\"javascript:history.go(-1)\">" . $lang['all_prev'] . "</a>" );
}
}


Version DLE: 9.x-10.x
Author: Vitnet
Source: dle-faq.ru

Aucun commentaire:

Enregistrer un commentaire