Implement creator studio and upload updates

This commit is contained in:
2026-04-04 10:12:02 +02:00
parent 1da7d3bf88
commit 0b216b7ecd
15107 changed files with 31206 additions and 626514 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace App\Services\Moderation\Rules;
use App\Contracts\Moderation\ModerationRuleInterface;
use App\Services\Moderation\ModerationRuleRegistryService;
class SuspiciousKeywordRule implements ModerationRuleInterface
{
public function analyze(string $content, string $normalized, array $context = []): array
{
$registry = app(ModerationRuleRegistryService::class);
$weights = app('config')->get('content_moderation.weights', []);
$findings = [];
$highRiskMatched = [];
$suspiciousMatched = [];
foreach ($registry->highRiskKeywords() as $phrase) {
if (str_contains($normalized, strtolower($phrase))) {
$highRiskMatched[] = $phrase;
}
}
foreach ($registry->suspiciousKeywords() as $phrase) {
if (str_contains($normalized, strtolower($phrase))) {
$suspiciousMatched[] = $phrase;
}
}
if (!empty($highRiskMatched)) {
$findings[] = [
'rule' => 'high_risk_keyword',
'score' => ($weights['high_risk_keyword'] ?? 40) * count($highRiskMatched),
'reason' => 'Contains high-risk keyword(s): ' . implode(', ', $highRiskMatched),
'links' => [],
'domains' => [],
'keywords' => $highRiskMatched,
];
}
if (!empty($suspiciousMatched)) {
$findings[] = [
'rule' => 'suspicious_keyword',
'score' => ($weights['suspicious_keyword'] ?? 25) * count($suspiciousMatched),
'reason' => 'Contains suspicious keyword(s): ' . implode(', ', $suspiciousMatched),
'links' => [],
'domains' => [],
'keywords' => $suspiciousMatched,
];
}
return $findings;
}
}