mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
fix hashtag and mentions count after fixing encoding and add tests
This commit is contained in:
@@ -184,8 +184,8 @@ class MessageFilter
|
||||
}
|
||||
}
|
||||
// hashtag count match
|
||||
if (substr($ruleText, 1, 4) === '>') {
|
||||
$hashtagLimit = (int)substr($ruleText, 5);
|
||||
if (substr($ruleText, 1, 1) === '>') {
|
||||
$hashtagLimit = (int)substr($ruleText, 2);
|
||||
$hashtagCount = 0;
|
||||
foreach ($this->tags as $t) {
|
||||
if ($t['ttype'] == TERM_HASHTAG || $t['ttype'] == TERM_COMMUNITYTAG) {
|
||||
@@ -206,8 +206,8 @@ class MessageFilter
|
||||
}
|
||||
}
|
||||
// mention count match
|
||||
if (substr($ruleText, 1, 4) === '>') {
|
||||
$mentionLimit = (int)substr($ruleText, 5);
|
||||
if (substr($ruleText, 1, 1) === '>') {
|
||||
$mentionLimit = (int)substr($ruleText, 2);
|
||||
$mentionCount = 0;
|
||||
foreach ($this->tags as $t) {
|
||||
if ($t['ttype'] == TERM_MENTION) {
|
||||
|
||||
@@ -117,6 +117,16 @@ class MessageFilterTest extends UnitTestCase {
|
||||
'#*',
|
||||
false
|
||||
],
|
||||
'max 1 hashtags (we got 3) in excl' => [
|
||||
'',
|
||||
'#>1',
|
||||
false
|
||||
],
|
||||
'max 4 hashtags (we got 3) in excl' => [
|
||||
'',
|
||||
'#>4',
|
||||
true
|
||||
],
|
||||
'item.body contains substring hopper in excl' => [
|
||||
'',
|
||||
'?body ~= hopper',
|
||||
|
||||
4
vendor/composer/installed.php
vendored
4
vendor/composer/installed.php
vendored
@@ -3,7 +3,7 @@
|
||||
'name' => 'zotlabs/hubzilla',
|
||||
'pretty_version' => 'dev-10.6RC',
|
||||
'version' => 'dev-10.6RC',
|
||||
'reference' => 'c03f543b54f1ad9d4bb6fc0b08cd5d054764c283',
|
||||
'reference' => '5432819788d7e84b919966d6e8e556919f34b892',
|
||||
'type' => 'application',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@@ -544,7 +544,7 @@
|
||||
'zotlabs/hubzilla' => array(
|
||||
'pretty_version' => 'dev-10.6RC',
|
||||
'version' => 'dev-10.6RC',
|
||||
'reference' => 'c03f543b54f1ad9d4bb6fc0b08cd5d054764c283',
|
||||
'reference' => '5432819788d7e84b919966d6e8e556919f34b892',
|
||||
'type' => 'application',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
||||
Reference in New Issue
Block a user