Merge pull request #9144 from annando/issue-9137

Issue 9137: Fix "Incorrect integer value:"
This commit is contained in:
Tobias Diekershoff 2020-09-06 11:54:23 +02:00 committed by GitHub
commit 058a3a2e7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;