Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K4.0] Max Links in message will divided by three if you insert a image #3334

Merged
merged 1 commit into from Aug 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions components/com_kunena/site/controllers/topic.php
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("/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU", $text, $matches);

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

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