Update (rss): block links that have less then 250 words
This commit is contained in:
@@ -3,6 +3,20 @@
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
if (! function_exists('count_words')) {
|
||||
function count_words($string) {
|
||||
// Remove punctuation and line breaks
|
||||
$cleanString = preg_replace('/[\p{P}\s]/u', ' ', $string);
|
||||
|
||||
// Split the string into words
|
||||
$words = preg_split('/\s+/', $cleanString, -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
// Count the words
|
||||
return count($words);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! function_exists('get_country_names')) {
|
||||
function get_country_names($lowercase = false) {
|
||||
$countryCodes = config('platform.country_codes');
|
||||
|
||||
Reference in New Issue
Block a user