"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;
*/
private static function getHideStatus($url)
{
- $curlResult = DI::httpRequest()->get($url);
+ $curlResult = DI::httpRequest()->get($url, false, ['content_length' => 1000000]);
if (!$curlResult->isSuccess()) {
return false;
}
- // If the file is too large then exit
- if (($curlResult->getInfo()['download_content_length'] ?? 0) > 1000000) {
- return false;
- }
-
// If it isn't a HTML file then exit
if (($curlResult->getContentType() != '') && !strstr(strtolower($curlResult->getContentType()), 'html')) {
return false;