castopod/app/Validation/Rules.php
Yassine Doghri aa1612342e
style(ecs): add easy-coding-standard to enforce coding style rules for php
- update .devcontainer settings: remove auto-formatting
for php + set intelephense as default formatter
- remove prettier php plugin as it lacks php 8 support
- add captain hook action for checking style pre-commit
- fix style with ecs on all files except views
2021-06-11 09:34:48 +00:00

27 lines
538 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.
*/
public function validate_url(string $str = null): bool
{
if ($str === null) {
return false;
}
return filter_var($str, FILTER_VALIDATE_URL) !== false;
}
//--------------------------------------------------------------------
}