Merge pull request #9144 from annando/issue-9137
Issue 9137: Fix "Incorrect integer value:"
This commit is contained in:
commit
058a3a2e7c
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