Skip to content

Commit

Permalink
[K4.0] Max Links in message will divided by three if you insert a image
Browse files Browse the repository at this point in the history
link #3318
  • Loading branch information
xillibit committed Aug 6, 2015
1 parent eccb0f5 commit 7c7b3d5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions components/com_kunena/site/controllers/topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,9 @@ protected function checkMaxLinks($text, $topic)

if ( !$ignore )
{
// Check max links in message to check spam
$http = substr_count($text, "http");
$href = substr_count($text, "href");
$url = substr_count($text, "[url");
preg_match_all("/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", $text, $matches);

$countlink = $http += $href += $url;
$countlink = count($matches[0]);

if (!$topic->authorise('approve') && $countlink >=$this->config->max_links +1) {
return false;
Expand Down

0 comments on commit 7c7b3d5

Please sign in to comment.