]> git.mxchange.org Git - friendica.git/blobdiff - util/global_community_silence.php
Merge pull request #4625 from annando/ostatus-groups
[friendica.git] / util / global_community_silence.php
index b90ea10eacfad5db3259d57cb1134318d38789f2..2eb76a47f4032d2006e52ee92eed7f826b31eab6 100755 (executable)
@@ -40,7 +40,7 @@ require_once 'boot.php';
 require_once 'include/dba.php';
 require_once 'include/text.php';
 $a = get_app();
-require_once'.htconfig.php';
+require_once '.htconfig.php';
 
 dba::connect($db_host, $db_user, $db_pass, $db_data);
 unset($db_host, $db_user, $db_pass, $db_data);
@@ -51,15 +51,15 @@ unset($db_host, $db_user, $db_pass, $db_data);
  * 3. set the flag hidden=1 for the contact entry with the found ID
  **/
 $net = Probe::uri($argv[1]);
-if (in_array($net['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
+if (in_array($net['network'], [NETWORK_PHANTOM, NETWORK_MAIL])) {
        echo "This account seems not to exist.";
        echo "\r\n";
        exit(1);
 }
 $nurl = normalise_link($net['url']);
-$r = dba::select("contact", array("id"), array("nurl" => $nurl, "uid" => 0), array("limit" => 1));
-if (DBM::is_result($r)) {
-       dba::update("contact", array("hidden" => true), array("id" => $r["id"]));
+$contact = dba::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
+if (DBM::is_result($contact)) {
+       dba::update("contact", ["hidden" => true], ["id" => $contact["id"]]);
        echo "NOTICE: The account should be silenced from the global community page\r\n";
 } else {
        echo "NOTICE: Could not find any entry for this URL (".$nurl.")\r\n";