InternalUrlValidator: Also check the scheme

This commit is contained in:
Johannes Meyer 2022-12-01 15:50:46 +01:00
parent 965aac11ef
commit 3187a4e549
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Web\Form\Validator;
use Icinga\Application\Icinga;
use Zend_Validate_Abstract;
use Icinga\Web\Url;
@ -16,7 +17,8 @@ class InternalUrlValidator extends Zend_Validate_Abstract
*/
public function isValid($value)
{
if (Url::fromPath($value)->getRelativeUrl() === '') {
$url = Url::fromPath($value);
if ($url->getRelativeUrl() === '' || $url->getScheme() !== Icinga::app()->getRequest()->getScheme()) {
$this->_error('IS_EXTERNAL');
return false;