| Server IP : _ / Your IP : 169.254.129.1 Web Server : nginx/1.28.0 System : Linux 89e302d72aa1 6.6.143.1-1.azl3 #1 SMP PREEMPT_DYNAMIC Mon Jul 6 04:01:14 UTC 2026 x86_64 User : nginx ( 103) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wordpress/wp-content/plugins/wp-rss-aggregator/src/Util/ |
Upload File : |
<?php
namespace RebelCode\Wpra\Core\Util;
/**
* Functionality for sanitizing a comma-separated string list into an array.
*
* @since 4.13
*/
trait SanitizeCommaListCapableTrait
{
/**
* Sanitizes a list of strings.
*
* @since 4.17
*
* @param string|array $value A comma separated string list or an array.
*
* @return array The list of strings.
*/
protected function sanitizeCommaList($value)
{
if (empty($value)) {
return [];
}
$array = is_array($value)
? $value
: explode(',', strval($value));
$ids = array_map(function ($part) {
return trim($part);
}, $array);
return array_filter($ids);
}
/**
* Sanitizes a list of IDs.
*
* @since 4.13
*
* @param string|array $value A comma separated string list or an array.
*
* @return array The list of IDs.
*/
protected function sanitizeIdCommaList($value)
{
return array_map('intval', $this->sanitizeCommaList($value));
}
}