Issue 9137: Fix "Incorrect integer value:"
This commit is contained in:
parent
abe6ecf820
commit
5af713b336
1 changed files with 4 additions and 2 deletions
|
@ -93,15 +93,17 @@ class Probe
|
||||||
"following", "followers", "inbox", "outbox", "sharedinbox",
|
"following", "followers", "inbox", "outbox", "sharedinbox",
|
||||||
"priority", "network", "pubkey", "manually-approve", "baseurl", "gsid"];
|
"priority", "network", "pubkey", "manually-approve", "baseurl", "gsid"];
|
||||||
|
|
||||||
|
$numeric_fields = ["gsid", "hide", "account-type", "manually-approve"];
|
||||||
|
|
||||||
$newdata = [];
|
$newdata = [];
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
if (isset($data[$field])) {
|
if (isset($data[$field])) {
|
||||||
if (in_array($field, ["gsid", "hide", "account-type", "manually-approve"])) {
|
if (in_array($field, $numeric_fields)) {
|
||||||
$newdata[$field] = (int)$data[$field];
|
$newdata[$field] = (int)$data[$field];
|
||||||
} else {
|
} else {
|
||||||
$newdata[$field] = $data[$field];
|
$newdata[$field] = $data[$field];
|
||||||
}
|
}
|
||||||
} elseif ($field != "gsid") {
|
} elseif (!in_array($field, $numeric_fields)) {
|
||||||
$newdata[$field] = "";
|
$newdata[$field] = "";
|
||||||
} else {
|
} else {
|
||||||
$newdata[$field] = null;
|
$newdata[$field] = null;
|
||||||
|
|
Loading…
Reference in a new issue