Skip to content

Commit 4bef1cd

Browse files
committed
Fix #110: correct processing of multiple IPs on webspace creation
1 parent 37f798d commit 4bef1cd

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/Api/Operator/Webspace.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ public function create(array $properties, array $hostingProperties = null, strin
7575

7676
$infoGeneral = $info->addChild('gen_setup');
7777
foreach ($properties as $name => $value) {
78-
$infoGeneral->addChild($name, $value);
78+
if (is_array($value)) {
79+
continue;
80+
} else {
81+
$infoGeneral->addChild($name, (string) $value);
82+
}
7983
}
8084

8185
if ($hostingProperties) {

tests/WebspaceTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,22 @@ public function testSetProperties()
222222

223223
static::$client->webspace()->delete('id', $webspace->id);
224224
}
225+
226+
public function testIpsAsArray()
227+
{
228+
$webspace = static::$client->webspace()->create(
229+
[
230+
'name' => "test-ips.test",
231+
'ip_address' => [static::getIpAddress()],
232+
],
233+
[
234+
'ftp_login' => "u-ips",
235+
'ftp_password' => PasswordProvider::STRONG_PASSWORD,
236+
]
237+
);
238+
239+
$this->assertGreaterThan(0, $webspace->id);
240+
241+
static::$client->webspace()->delete('id', $webspace->id);
242+
}
225243
}

0 commit comments

Comments
 (0)