RSS Aggregator for Gemini Protocol
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Yggverse\Pulsar\Model;
|
|
|
|
|
|
|
|
class Filter
|
|
|
|
{
|
|
|
|
public static function url(
|
|
|
|
string $value
|
|
|
|
): string
|
|
|
|
{
|
|
|
|
return trim(
|
|
|
|
urldecode(
|
|
|
|
$value
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function title(
|
|
|
|
string $value
|
|
|
|
): string
|
|
|
|
{
|
|
|
|
return trim(
|
|
|
|
preg_replace(
|
|
|
|
[
|
|
|
|
'/[\n\r]+/',
|
|
|
|
'/[\s]{2,}/',
|
|
|
|
],
|
|
|
|
' ',
|
|
|
|
self::text(
|
|
|
|
$value
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function description(
|
|
|
|
string $value
|
|
|
|
): string
|
|
|
|
{
|
|
|
|
return self::text(
|
|
|
|
$value
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function text(
|
|
|
|
string $value
|
|
|
|
): string
|
|
|
|
{
|
|
|
|
return trim(
|
|
|
|
preg_replace(
|
|
|
|
[
|
|
|
|
'/[\n\r]{2,}/',
|
|
|
|
'/[\s]{2,}/',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
PHP_EOL,
|
|
|
|
' '
|
|
|
|
],
|
|
|
|
strip_tags(
|
|
|
|
html_entity_decode(
|
|
|
|
$value
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|