Skip to content

Commit 864e8d1

Browse files
committed
Restoring checks removed in #11 (makes Phing ci fail)
1 parent 5e89d22 commit 864e8d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/VisualizerTask.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
use SimpleXMLElement;
3232
use XSLTProcessor;
3333
use function array_reduce;
34+
use function filter_var;
3435
use function reset;
3536
use function simplexml_load_string;
37+
use const FILTER_VALIDATE_URL;
3638

3739
/**
3840
* Class VisualizerTask
@@ -354,6 +356,11 @@ public function getServer(): string
354356
*/
355357
public function setServer(string $server): VisualizerTask
356358
{
359+
if (!filter_var($server, FILTER_VALIDATE_URL)) {
360+
$exceptionMessage = 'Invalid PlantUml server';
361+
$this->log($exceptionMessage, Project::MSG_ERR);
362+
throw new BuildException($exceptionMessage);
363+
}
357364
$this->server = $server;
358365

359366
return $this;

0 commit comments

Comments
 (0)