Permalink
Browse files

Prohibit links in a subject

For $pun_user['g_post_links'] != '1' added prohibitions of links in
subject title (regex: %(?:h\s*t|f)\s*t\s*p\s*(?:s\s*)?:\s*/\s*/%).
Will stop 'http://'... and 'h tt p s://...'.

Fixes #1097.

# Conflicts:
#	post.php
  • Loading branch information...
MioVisman authored and franzliedke committed Nov 26, 2016
1 parent 54c6bd7 commit 4ad5078144bc1ec3a30980fb8a980eb060b16276
Showing with 4 additions and 0 deletions.
  1. +2 −0 edit.php
  2. +2 −0 post.php
@@ -75,6 +75,8 @@
$errors[] = $lang_post['Too long subject'];
else if ($pun_config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$pun_user['is_admmod'])
$errors[] = $lang_post['All caps subject'];
else if ($pun_user['g_post_links'] != '1' && preg_match('%(?:h\s*t|f)\s*t\s*p\s*(?:s\s*)?:\s*/\s*/%', $subject))
$errors[] = $lang_common['BBCode error tag url not allowed'];
}
// Clean up message from POST
@@ -90,6 +90,8 @@
$errors[] = $lang_post['Too long subject'];
else if ($pun_config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$pun_user['is_admmod'])
$errors[] = $lang_post['All caps subject'];
else if ($pun_user['g_post_links'] != '1' && preg_match('%(?:h\s*t|f)\s*t\s*p\s*(?:s\s*)?:\s*/\s*/%', $subject))
$errors[] = $lang_common['BBCode error tag url not allowed'];
}
}

0 comments on commit 4ad5078

Please sign in to comment.