castopod/app/Validation/Rules.php
Yassine Doghri 54b84f9684
perf(cache): update CI4 to use cache's deleteMatching method
add missing locale to category_options cache name
2021-05-03 15:32:46 +00:00

31 lines
599 B
PHP

<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Validation;
class Rules
{
/**
* Checks a URL to ensure it's formed correctly.
*
* @param string $str
*
* @return boolean
*/
public function validate_url(string $str = null): bool
{
if (empty($str)) {
return false;
}
return filter_var($str, FILTER_VALIDATE_URL) !== false;
}
//--------------------------------------------------------------------
}