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",
|
||||
"priority", "network", "pubkey", "manually-approve", "baseurl", "gsid"];
|
||||
|
||||
$numeric_fields = ["gsid", "hide", "account-type", "manually-approve"];
|
||||
|
||||
$newdata = [];
|
||||
foreach ($fields as $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];
|
||||
} else {
|
||||
$newdata[$field] = $data[$field];
|
||||
}
|
||||
} elseif ($field != "gsid") {
|
||||
} elseif (!in_array($field, $numeric_fields)) {
|
||||
$newdata[$field] = "";
|
||||
} else {
|
||||
$newdata[$field] = null;
|
||||
|
|
Loading…
Reference in a new issue