Skip to content

Commit c732504

Browse files
authored
Merge pull request #5998 from 3liz/backport-5997-to-release_3_9
[Backport release_3_9] check URL when submitting AccessControlAllowOrigin in admin Form
2 parents 1da242c + 6f7a637 commit c732504

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lizmap/modules/admin/controllers/maps.classic.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use Jelix\FileUtilities\Path;
4+
use Lizmap\Project\Repository;
45
use Lizmap\Project\UnknownLizmapProjectException;
56
use Lizmap\Request\Proxy;
67
use LizmapAdmin\RepositoryRightsService;
@@ -488,7 +489,7 @@ public function saveSection()
488489
$domain = 'https://'.$domain;
489490
}
490491
$urlParts = parse_url($domain);
491-
if ($urlParts === false) {
492+
if ($urlParts === false || !filter_var($domain, FILTER_VALIDATE_URL)) {
492493
$form->setErrorOn('accessControlAllowOrigin', jLocale::get('admin~admin.form.admin_section.message.accessControlAllowOrigin.bad.domain'));
493494
$ok = $okDomain = false;
494495

@@ -530,7 +531,7 @@ public function saveSection()
530531

531532
// Repository data
532533
$data = array();
533-
foreach (lizmapRepository::getProperties() as $prop) {
534+
foreach (Repository::getProperties() as $prop) {
534535
$data[$prop] = $form->getData($prop);
535536
// Check paths
536537
if ($prop == 'path') {

0 commit comments

Comments
 (0)