$question["text"], "%r" => $question["responsetext"], "%u" => $url ) as $replace => $text) { $cw = str_replace($replace, $text, $cw); $msg = str_replace($replace, $text, $msg); } $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: {$fediAPIToken}")); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $route); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( "status" => $msg, "visibility" => $fediVisibility, "spoiler_text" => $cw ))); $resp = curl_exec($ch); if (strlen($question["fedipostid"]) == 0) { $jsonResp = json_decode($resp, true); $fediID = $jsonResp["id"]; pg_update($db, "data", array("fedipostid" => $fediID), array("id" => $id)); } curl_close($ch); ?>