Browse Source

Merge pull request #3043 from Quix0r/rewrites/dbm_is_result

More usage of dbm::is_result + coding convention applied
pull/3077/head
Michael Vogel 4 years ago
committed by GitHub
parent
commit
ee39aba490
161 changed files with 716 additions and 664 deletions
  1. +5
    -4
      boot.php
  2. +3
    -3
      doc/Plugins.md
  3. +1
    -1
      doc/autoloader.md
  4. +3
    -3
      doc/de/Plugins.md
  5. +3
    -3
      doc/themes.md
  6. +3
    -3
      include/Contact.php
  7. +4
    -4
      include/acl_selectors.php
  8. +6
    -6
      include/api.php
  9. +6
    -4
      include/contact_widgets.php
  10. +3
    -3
      include/cron.php
  11. +1
    -1
      include/dfrn.php
  12. +8
    -5
      include/diaspora.php
  13. +1
    -1
      include/event.php
  14. +28
    -39
      include/follow.php
  15. +67
    -29
      include/identity.php
  16. +22
    -17
      include/items.php
  17. +2
    -1
      include/like.php
  18. +1
    -1
      include/nav.php
  19. +29
    -24
      include/network.php
  20. +24
    -21
      include/plugin.php
  21. +1
    -1
      include/poller.php
  22. +2
    -2
      include/queue.php
  23. +3
    -2
      include/socgraph.php
  24. +1
    -1
      include/text.php
  25. +9
    -6
      include/user.php
  26. +23
    -28
      library/spam/b8/storage/storage_frndc.php
  27. +3
    -2
      mod/_well_known.php
  28. +1
    -1
      mod/acctlink.php
  29. +1
    -1
      mod/acl.php
  30. +28
    -28
      mod/admin.php
  31. +17
    -17
      mod/allfriends.php
  32. +1
    -1
      mod/amcd.php
  33. +2
    -2
      mod/api.php
  34. +1
    -1
      mod/apps.php
  35. +1
    -1
      mod/attach.php
  36. +1
    -1
      mod/babel.php
  37. +2
    -2
      mod/bookmarklet.php
  38. +2
    -2
      mod/cal.php
  39. +4
    -4
      mod/cb.php
  40. +3
    -2
      mod/common.php
  41. +1
    -1
      mod/community.php
  42. +1
    -1
      mod/contactgroup.php
  43. +36
    -31
      mod/contacts.php
  44. +1
    -1
      mod/credits.php
  45. +3
    -3
      mod/crepair.php
  46. +3
    -5
      mod/delegate.php
  47. +9
    -6
      mod/dfrn_confirm.php
  48. +2
    -2
      mod/dfrn_notify.php
  49. +5
    -5
      mod/dfrn_poll.php
  50. +13
    -14
      mod/dfrn_request.php
  51. +3
    -3
      mod/directory.php
  52. +1
    -1
      mod/dirfind.php
  53. +1
    -1
      mod/display.php
  54. +2
    -2
      mod/editpost.php
  55. +6
    -5
      mod/events.php
  56. +1
    -2
      mod/fbrowser.php
  57. +1
    -1
      mod/fetch.php
  58. +1
    -1
      mod/filer.php
  59. +1
    -1
      mod/filerm.php
  60. +2
    -2
      mod/follow.php
  61. +2
    -2
      mod/friendica.php
  62. +2
    -2
      mod/fsuggest.php
  63. +5
    -6
      mod/group.php
  64. +1
    -2
      mod/hcard.php
  65. +1
    -1
      mod/help.php
  66. +2
    -2
      mod/home.php
  67. +1
    -1
      mod/hostxrd.php
  68. +1
    -1
      mod/hovercard.php
  69. +1
    -1
      mod/ignored.php
  70. +4
    -5
      mod/install.php
  71. +3
    -3
      mod/invite.php
  72. +11
    -9
      mod/item.php
  73. +1
    -1
      mod/like.php
  74. +2
    -2
      mod/localtime.php
  75. +1
    -1
      mod/lockview.php
  76. +1
    -1
      mod/login.php
  77. +4
    -2
      mod/lostpass.php
  78. +1
    -1
      mod/maintenance.php
  79. +2
    -2
      mod/manage.php
  80. +1
    -1
      mod/match.php
  81. +4
    -4
      mod/message.php
  82. +1
    -1
      mod/modexp.php
  83. +2
    -2
      mod/mood.php
  84. +1
    -1
      mod/msearch.php
  85. +1
    -1
      mod/navigation.php
  86. +12
    -13
      mod/network.php
  87. +1
    -1
      mod/newmember.php
  88. +2
    -2
      mod/nodeinfo.php
  89. +2
    -2
      mod/nogroup.php
  90. +1
    -1
      mod/noscrape.php
  91. +1
    -1
      mod/notes.php
  92. +1
    -1
      mod/notice.php
  93. +2
    -2
      mod/notifications.php
  94. +2
    -3
      mod/notify.php
  95. +1
    -1
      mod/oembed.php
  96. +2
    -2
      mod/oexchange.php
  97. +1
    -1
      mod/openid.php
  98. +1
    -1
      mod/opensearch.php
  99. +1
    -1
      mod/ostatus_subscribe.php
  100. +1
    -1
      mod/parse_url.php

+ 5
- 4
boot.php View File

@ -1540,7 +1540,7 @@ function check_db() {
* Sets the base url for use in cmdline programs which don't have
* $_SERVER variables
*/
function check_url(&$a) {
function check_url(App &$a) {
$url = get_config('system','url');
@ -1562,7 +1562,7 @@ function check_url(&$a) {
/**
* @brief Automatic database updates
*/
function update_db(&$a) {
function update_db(App &$a) {
$build = get_config('system','build');
if(! x($build))
$build = set_config('system','build',DB_UPDATE_VERSION);
@ -1678,7 +1678,7 @@ function run_update_function($x) {
* @param App $a
*
*/
function check_plugins(&$a) {
function check_plugins(App &$a) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
if (dbm::is_result($r))
@ -2413,7 +2413,8 @@ function get_temppath() {
return("");
}
function set_template_engine(&$a, $engine = 'internal') {
/// @deprecated
function set_template_engine(App &$a, $engine = 'internal') {
/// @note This function is no longer necessary, but keep it as a wrapper to the class method
/// to avoid breaking themes again unnecessarily


+ 3
- 3
doc/Plugins.md View File

@ -77,9 +77,9 @@ This will include:
$a->argc = 3
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
Your module functions will often contain the function plugin_name_content(&$a), which defines and returns the page body content.
They may also contain plugin_name_post(&$a) which is called before the _content function and typically handles the results of POST forms.
You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
Your module functions will often contain the function plugin_name_content(App &$a), which defines and returns the page body content.
They may also contain plugin_name_post(App &$a) which is called before the _content function and typically handles the results of POST forms.
You may also have plugin_name_init(App &$a) which is called very early on and often does module initialisation.
Templates
---


+ 1
- 1
doc/autoloader.md View File

@ -68,7 +68,7 @@ The code will be something like:
file: mod/network.php
<?php
function network_content(&$a) {
function network_content(App &$a) {
$itemsmanager = new \Friendica\ItemsManager();
$items = $itemsmanager->getAll();


+ 3
- 3
doc/de/Plugins.md View File

@ -67,9 +67,9 @@ So würde http://example.com/plugin/arg1/arg2 nach einem Modul "plugin" suchen u
$a->argc = 3
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(&$a), welche den Seiteninhalt definiert und zurückgibt.
Sie können auch plugin_name_post(&$a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
Du kannst ebenso plugin_name_init(&$a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(App &$a), welche den Seiteninhalt definiert und zurückgibt.
Sie können auch plugin_name_post(App &$a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
Du kannst ebenso plugin_name_init(App &$a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
Derzeitige Hooks


+ 3
- 3
doc/themes.md View File

@ -122,7 +122,7 @@ the 1st part of the line is the name of the CSS file (without the .css) the 2nd
Calling the t() function with the common name makes the string translateable.
The selected 1st part will be saved in the database by the theme_post function.
function theme_post(&$a){
function theme_post(App &$a){
// non local users shall not pass
if (! local_user()) {
return;
@ -168,7 +168,7 @@ The content of this file should be something like
<?php
/* meta informations for the theme, see below */
function duepuntozero_lr_init(&$a) {
function duepuntozero_lr_init(App &$a) {
$a-> theme_info = array(
'extends' => 'duepuntozero'.
);
@ -251,7 +251,7 @@ Next crucial part of the theme.php file is a definition of an init function.
The name of the function is <theme-name>_init.
So in the case of quattro it is
function quattro_init(&$a) {
function quattro_init(App &$a) {
$a->theme_info = array();
set_template_engine($a, 'smarty3');
}


+ 3
- 3
include/Contact.php View File

@ -85,7 +85,7 @@ function contact_remove($id) {
function terminate_friendship($user,$self,$contact) {
/// @TODO Get rid of this, include/datetime.php should care about by itself
/// @TODO Get rid of this, include/datetime.php should care about it by itself
$a = get_app();
require_once('include/datetime.php');
@ -226,14 +226,14 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
dbesc(normalise_link($url)), intval($uid));
// Fetch the data from the contact table with "uid=0" (which is filled automatically)
if (!$r)
if (!dbm::is_result($r))
$r = q("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self`
FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0",
dbesc(normalise_link($url)));
// Fetch the data from the gcontact table
if (!$r)
if (!dbm::is_result($r))
$r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`,
`keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self`
FROM `gcontact` WHERE `nurl` = '%s'",


+ 4
- 4
include/acl_selectors.php View File

@ -272,7 +272,7 @@ function prune_deadguys($arr) {
$r = q("SELECT `id` FROM `contact` WHERE `id` IN ( " . $str . ") AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 ");
if ($r) {
if (dbm::is_result($r)) {
$ret = array();
foreach ($r as $rr) {
$ret[] = intval($rr['id']);
@ -585,9 +585,9 @@ function acl_lookup(&$a, $out_type = 'json') {
);
echo json_encode($o);
killme();
}
else
} else {
$r = array();
}
if (dbm::is_result($r)) {
@ -691,7 +691,7 @@ function acl_lookup(&$a, $out_type = 'json') {
* @param App $a
* @return array with the search results
*/
function navbar_complete(&$a) {
function navbar_complete(App &$a) {
// logger('navbar_complete');


+ 6
- 6
include/api.php View File

@ -133,7 +133,7 @@
* @hook 'logged_in'
* array $user logged user record
*/
function api_login(&$a){
function api_login(App &$a){
// login with oauth
try{
$oauth = new FKOAuth1();
@ -251,8 +251,8 @@
* @param App $a
* @return string API call result
*/
function api_call(&$a){
GLOBAL $API, $called_api;
function api_call(App &$a){
global $API, $called_api;
$type="json";
if (strpos($a->query_string, ".xml")>0) $type="xml";
@ -3590,7 +3590,7 @@
intval($gid),
dbesc($name));
// error message if specified gid is not in database
if (count($rname) == 0)
if (!dbm::is_result($rname))
throw new BadRequestException('wrong group name');
// delete group
@ -3629,7 +3629,7 @@
intval($uid),
dbesc($name));
// error message if specified group name already exists
if (count($rname) != 0)
if (dbm::is_result($rname))
throw new BadRequestException('group name already exists');
// check if specified group name is a deleted group
@ -3637,7 +3637,7 @@
intval($uid),
dbesc($name));
// error message if specified group name already exists
if (count($rname) != 0)
if (dbm::is_result($rname))
$reactivate_group = true;
// create group


+ 6
- 4
include/contact_widgets.php View File

@ -135,8 +135,8 @@ function fileas_widget($baseurl,$selected = '') {
$matches = false;
$terms = array();
$cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER);
if($cnt) {
$cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER);
if ($cnt) {
foreach($matches as $mtch) {
$unescaped = xmlify(file_tag_decode($mtch[1]));
$terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
@ -158,12 +158,14 @@ function categories_widget($baseurl,$selected = '') {
$a = get_app();
if(! feature_enabled($a->profile['profile_uid'],'categories'))
if (! feature_enabled($a->profile['profile_uid'],'categories')) {
return '';
}
$saved = get_pconfig($a->profile['profile_uid'],'system','filetags');
if(! strlen($saved))
if (! strlen($saved)) {
return;
}
$matches = false;
$terms = array();


+ 3
- 3
include/cron.php View File

@ -264,7 +264,7 @@ function cron_poll_contacts($argc, $argv) {
intval($c['id'])
);
if((! $res) || (! count($res)))
if (dbm::is_result($res))
continue;
foreach($res as $contact) {
@ -343,7 +343,7 @@ function cron_poll_contacts($argc, $argv) {
*
* @param App $a
*/
function cron_clear_cache(&$a) {
function cron_clear_cache(App &$a) {
$last = get_config('system','cache_last_cleared');
@ -430,7 +430,7 @@ function cron_clear_cache(&$a) {
*
* @param App $a
*/
function cron_repair_diaspora(&$a) {
function cron_repair_diaspora(App &$a) {
$r = q("SELECT `id`, `url` FROM `contact`
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));


+ 1
- 1
include/dfrn.php View File

@ -2355,7 +2355,7 @@ class dfrn {
dbesc($xt->id),
intval($importer["importer_uid"])
);
if(count($i)) {
if (dbm::is_result($i)) {
// For tags, the owner cannot remove the tag on the author's copy of the post.


+ 8
- 5
include/diaspora.php View File

@ -2283,8 +2283,9 @@ class Diaspora {
dbesc($target_guid),
intval($importer["uid"])
);
if (!$r)
if (!$r) {
return false;
}
// Check if the sender is the thread owner
$p = q("SELECT `id`, `author-link`, `origin` FROM `item` WHERE `id` = %d",
@ -2307,7 +2308,7 @@ class Diaspora {
logger("Deleted target ".$target_guid." (".$r[0]["id"].") from user ".$importer["uid"]." parent: ".$p[0]["id"], LOGGER_DEBUG);
// Now check if the retraction needs to be relayed by us
if($p[0]["origin"]) {
if ($p[0]["origin"]) {
// notify others
proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $r[0]["id"]);
}
@ -2478,15 +2479,17 @@ class Diaspora {
* @return string the handle in the format user@domain.tld
*/
private static function my_handle($contact) {
if ($contact["addr"] != "")
if ($contact["addr"] != "") {
return $contact["addr"];
}
// Normally we should have a filled "addr" field - but in the past this wasn't the case
// So - just in case - we build the the address here.
if ($contact["nickname"] != "")
if ($contact["nickname"] != "") {
$nick = $contact["nickname"];
else
} else {
$nick = $contact["nick"];
}
return $nick."@".substr(App::get_baseurl(), strpos(App::get_baseurl(),"://") + 3);
}


+ 1
- 1
include/event.php View File

@ -206,7 +206,7 @@ function bbtoevent($s) {
}
function sort_by_date($a) {
function sort_by_date(App &$a) {
usort($a,'ev_compare');
return $a;


+ 28
- 39
include/follow.php View File

@ -102,8 +102,7 @@ function new_contact($uid,$url,$interactive = false) {
if ($interactive) {
if (strlen($a->path)) {
$myaddr = bin2hex(App::get_baseurl() . '/profile/' . $a->user['nickname']);
}
else {
} else {
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname());
}
@ -111,53 +110,43 @@ function new_contact($uid,$url,$interactive = false) {
// NOTREACHED
}
} elseif (get_config('system','dfrn_only')) {
$result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
$result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result;
}
else {
if(get_config('system','dfrn_only')) {
$result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
$result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result;
}
}
// This extra param just confuses things, remove it
if($ret['network'] === NETWORK_DIASPORA)
if ($ret['network'] === NETWORK_DIASPORA) {
$ret['url'] = str_replace('?absolute=true','',$ret['url']);
}
// do we have enough information?
if(! ((x($ret,'name')) && (x($ret,'poll')) && ((x($ret,'url')) || (x($ret,'addr'))))) {
if (! ((x($ret,'name')) && (x($ret,'poll')) && ((x($ret,'url')) || (x($ret,'addr'))))) {
$result['message'] .= t('The profile address specified does not provide adequate information.') . EOL;
if(! x($ret,'poll'))
if (! x($ret,'poll')) {
$result['message'] .= t('No compatible communication protocols or feeds were discovered.') . EOL;
if(! x($ret,'name'))
}
if (! x($ret,'name')) {
$result['message'] .= t('An author or name was not found.') . EOL;
if(! x($ret,'url'))
}
if (! x($ret,'url')) {
$result['message'] .= t('No browser URL could be matched to this address.') . EOL;
if(strpos($url,'@') !== false) {
}
if (strpos($url,'@') !== false) {
$result['message'] .= t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
$result['message'] .= t('Use mailto: in front of address to force email check.') . EOL;
}
return $result;
}
if($ret['network'] === NETWORK_OSTATUS && get_config('system','ostatus_disabled')) {
if ($ret['network'] === NETWORK_OSTATUS && get_config('system','ostatus_disabled')) {
$result['message'] .= t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
$ret['notify'] = '';
}
if(! $ret['notify']) {
if (! $ret['notify']) {
$result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
}
@ -167,8 +156,9 @@ function new_contact($uid,$url,$interactive = false) {
$hidden = (($ret['network'] === NETWORK_MAIL) ? 1 : 0);
if(in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA)))
if (in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA))) {
$writeable = 1;
}
// check if we already have a contact
// the poll url is more reliable than the profile url, as we may have
@ -188,7 +178,7 @@ function new_contact($uid,$url,$interactive = false) {
if (dbm::is_result($r)) {
// update contact
if($r[0]['rel'] == CONTACT_IS_FOLLOWER || ($network === NETWORK_DIASPORA && $r[0]['rel'] == CONTACT_IS_SHARING)) {
if ($r[0]['rel'] == CONTACT_IS_FOLLOWER || ($network === NETWORK_DIASPORA && $r[0]['rel'] == CONTACT_IS_SHARING)) {
q("UPDATE `contact` SET `rel` = %d , `subhub` = %d, `readonly` = 0 WHERE `id` = %d AND `uid` = %d",
intval(CONTACT_IS_FRIEND),
intval($subhub),
@ -197,29 +187,28 @@ function new_contact($uid,$url,$interactive = false) {
);
}
} else {
// check service class limits
$r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0",
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `pending` = 0 AND `self` = 0",
intval($uid)
);
if (dbm::is_result($r))
$total_contacts = $r[0]['total'];
if(! service_class_allows($uid,'total_contacts',$total_contacts)) {
if (! service_class_allows($uid,'total_contacts',$total_contacts)) {
$result['message'] .= upgrade_message();
return $result;
}
$r = q("select count(network) as total from contact where uid = %d and network = '%s' and pending = 0 and self = 0",
$r = q("SELECT COUNT(`network`) AS `total` FROM `contact` WHERE `uid` = %d AND `network` = '%s' AND `pending` = 0 AND `self` = 0",
intval($uid),
dbesc($network)
);
if (dbm::is_result($r))
if (dbm::is_result($r)) {
$total_network = $r[0]['total'];
}
if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
if (! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
$result['message'] .= upgrade_message();
return $result;
}
@ -268,8 +257,9 @@ function new_contact($uid,$url,$interactive = false) {
$result['cid'] = $contact_id;
$def_gid = get_default_group($uid, $contact["network"]);
if (intval($def_gid))
if (intval($def_gid)) {
group_add_member($uid, '', $contact_id, $def_gid);
}
// Update the avatar
update_contact_avatar($ret['photo'],$uid,$contact_id);
@ -285,7 +275,6 @@ function new_contact($uid,$url,$interactive = false) {
if (dbm::is_result($r)) {
if (($contact['network'] == NETWORK_OSTATUS) && (strlen($contact['notify']))) {
// create a follow slap
$item = array();
$item['verb'] = ACTIVITY_FOLLOW;


+ 67
- 29
include/identity.php View File

@ -231,8 +231,7 @@ function profile_sidebar($profile, $block = 0) {
if ($connect AND local_user()) {
if (isset($profile["url"])) {
$profile_url = normalise_link($profile["url"]);
}
else {
} else {
$profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]);
}
@ -599,7 +598,7 @@ function get_events() {
));
}
function advanced_profile(&$a) {
function advanced_profile(App &$a) {
$o = '';
$uid = $a->profile['uid'];
@ -638,50 +637,87 @@ function advanced_profile(&$a) {
if($a->profile['marital']) $profile['marital'] = array( t('Status:'), $a->profile['marital']);
/// @TODO Maybe use x() here, plus below?
if ($a->profile['with']) {
$profile['marital']['with'] = $a->profile['with'];
}
if($a->profile['with']) $profile['marital']['with'] = $a->profile['with'];
if(strlen($a->profile['howlong']) && $a->profile['howlong'] !== '0000-00-00 00:00:00') {
$profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
if (strlen($a->profile['howlong']) && $a->profile['howlong'] !== '0000-00-00 00:00:00') {
$profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
}
if($a->profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] );
if ($a->profile['sexual']) {
$profile['sexual'] = array( t('Sexual Preference:'), $a->profile['sexual'] );
}
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
if ($a->profile['homepage']) {
$profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
}
if($a->profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) );
if ($a->profile['hometown']) {
$profile['hometown'] = array( t('Hometown:'), linkify($a->profile['hometown']) );
}
if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
if ($a->profile['pub_keywords']) {
$profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
}
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
if ($a->profile['politic']) {
$profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
}
if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']);
if ($a->profile['religion']) {
$profile['religion'] = array( t('Religion:'), $a->profile['religion']);
}
if($txt = prepare_text($a->profile['about'])) $profile['about'] = array( t('About:'), $txt );
if ($txt = prepare_text($a->profile['about'])) {
$profile['about'] = array( t('About:'), $txt );
}
if($txt = prepare_text($a->profile['interest'])) $profile['interest'] = array( t('Hobbies/Interests:'), $txt);
if ($txt = prepare_text($a->profile['interest'])) {
$profile['interest'] = array( t('Hobbies/Interests:'), $txt);
}
if($txt = prepare_text($a->profile['likes'])) $profile['likes'] = array( t('Likes:'), $txt);
if ($txt = prepare_text($a->profile['likes'])) {
$profile['likes'] = array( t('Likes:'), $txt);
}
if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
if ($txt = prepare_text($a->profile['dislikes'])) {
$profile['dislikes'] = array( t('Dislikes:'), $txt);
}
if ($txt = prepare_text($a->profile['contact'])) {
$profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
}
if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
if ($txt = prepare_text($a->profile['music'])) {
$profile['music'] = array( t('Musical interests:'), $txt);
}
if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);
if ($txt = prepare_text($a->profile['book'])) {
$profile['book'] = array( t('Books, literature:'), $txt);
}
if($txt = prepare_text($a->profile['book'])) $profile['book'] = array( t('Books, literature:'), $txt);
if ($txt = prepare_text($a->profile['tv'])) {
$profile['tv'] = array( t('Television:'), $txt);
}
if($txt = prepare_text($a->profile['tv'])) $profile['tv'] = array( t('Television:'), $txt);
if ($txt = prepare_text($a->profile['film'])) {
$profile['film'] = array( t('Film/dance/culture/entertainment:'), $txt);
}
if($txt = prepare_text($a->profile['film'])) $profile['film'] = array( t('Film/dance/culture/entertainment:'), $txt);
if ($txt = prepare_text($a->profile['romance'])) {
$profile['romance'] = array( t('Love/Romance:'), $txt);
}
if($txt = prepare_text($a->profile['romance'])) $profile['romance'] = array( t('Love/Romance:'), $txt);
if ($txt = prepare_text($a->profile['work'])) {
$profile['work'] = array( t('Work/employment:'), $txt);
}
if($txt = prepare_text($a->profile['work'])) $profile['work'] = array( t('Work/employment:'), $txt);
if ($txt = prepare_text($a->profile['education'])) {
$profile['education'] = array( t('School/education:'), $txt );
}
if($txt = prepare_text($a->profile['education'])) $profile['education'] = array( t('School/education:'), $txt );
//show subcribed forum if it is enabled in the usersettings
if (feature_enabled($uid,'forumlist_profile')) {
$profile['forumlist'] = array( t('Forums:'), ForumManager::profile_advanced($uid));
@ -705,11 +741,13 @@ function advanced_profile(&$a) {
function profile_tabs($a, $is_owner=False, $nickname=Null){
//echo "<pre>"; var_dump($a->user); killme();
if (is_null($nickname))
if (is_null($nickname)) {
$nickname = $a->user['nickname'];
}
if(x($_GET,'tab'))
if (x($_GET,'tab')) {
$tab = notags(trim($_GET['tab']));
}
$url = App::get_baseurl() . '/profile/' . $nickname;
@ -807,7 +845,7 @@ function get_my_url() {
return false;
}
function zrl_init(&$a) {
function zrl_init(App &$a) {
$tmp_str = get_my_url();
if(validate_url($tmp_str)) {


+ 22
- 17
include/items.php View File

@ -704,7 +704,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// If its a post from myself then tag the thread as "mention"
logger("item_store: Checking if parent ".$parent_id." has to be tagged as mention for user ".$arr['uid'], LOGGER_DEBUG);
$u = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($arr['uid']));
if (count($u)) {
if (dbm::is_result($u)) {
$a = get_app();
$self = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
logger("item_store: 'myself' is ".$self." for parent ".$parent_id." checking against ".$arr['author-link']." and ".$arr['owner-link'], LOGGER_DEBUG);
@ -953,14 +953,16 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// in it.
if (!$deleted AND !$dontcache) {
$r = q('SELECT * FROM `item` WHERE id = %d', intval($current_post));
if (count($r) == 1) {
if ($notify)
$r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
if ((dbm::is_result($r)) && (count($r) == 1)) {
if ($notify) {
call_hooks('post_local_end', $r[0]);
else
} else {
call_hooks('post_remote_end', $r[0]);
} else
}
} else {
logger('item_store: new item not found in DB, id ' . $current_post);
}
}
if ($arr['parent-uri'] === $arr['uri']) {
@ -994,8 +996,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
check_item_notification($current_post, $uid);
if ($notify)
if ($notify) {
proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post);
}
return $current_post;
}
@ -1188,19 +1191,22 @@ function tag_deliver($uid,$item_id) {
$u = q("select * from user where uid = %d limit 1",
intval($uid)
);
if (! count($u))
if (! dbm::is_result($u)) {
return;
}
$community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
$prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
$i = q("select * from item where id = %d and uid = %d limit 1",
$i = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item_id),
intval($uid)
);
if (! count($i))
if (! dbm::is_result($i)) {
return;
}
$item = $i[0];
@ -1257,7 +1263,7 @@ function tag_deliver($uid,$item_id) {
$c = q("select name, url, thumb from contact where self = 1 and uid = %d limit 1",
intval($u[0]['uid'])
);
if (! count($c)) {
if (! dbm::is_result($c)) {
return;
}
@ -1290,8 +1296,6 @@ function tag_deliver($uid,$item_id) {
function tgroup_check($uid,$item) {
$a = get_app();
$mention = false;
// check that the message originated elsewhere and is a top-level post
@ -1299,12 +1303,13 @@ function tgroup_check($uid,$item) {
if (($item['wall']) || ($item['origin']) || ($item['uri'] != $item['parent-uri']))
return false;
$u = q("select * from user where uid = %d limit 1",
/// @TODO Encapsulate this or find it encapsulated and replace all occurrances
$u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if (! count($u))
if (! dbm::is_result($u)) {
return false;
}
$community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
$prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
@ -2228,7 +2233,7 @@ function posted_date_widget($url,$uid,$wall) {
$ret = list_post_dates($uid,$wall);
if (! count($ret))
if (! dbm::is_result($ret))
return $o;
$cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years;


+ 2
- 1
include/like.php View File

@ -112,8 +112,9 @@ function do_like($item_id, $verb) {
intval($_SESSION['visitor_id']),
intval($owner_uid)
);
if (dbm::is_result($r))
if (dbm::is_result($r)) {
$contact = $r[0];
}
}
if (! $contact) {
return false;


+ 1
- 1
include/nav.php View File

@ -1,6 +1,6 @@
<?php
function nav(&$a) {
function nav(App &$a) {
/*
*


+ 29
- 24
include/network.php View File

@ -541,10 +541,11 @@ function parse_xml_string($s,$strict = true) {
libxml_use_internal_errors(true);
$x = @simplexml_load_string($s2);
if(! $x) {
if (! $x) {
logger('libxml: parse: error: ' . $s2, LOGGER_DATA);
foreach(libxml_get_errors() as $err)
foreach (libxml_get_errors() as $err) {
logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
}
libxml_clear_errors();
}
return $x;
@ -553,8 +554,9 @@ function parse_xml_string($s,$strict = true) {
function scale_external_images($srctext, $include_link = true, $scale_replace = false) {
// Suppress "view full size"
if (intval(get_config('system','no_view_full_size')))
if (intval(get_config('system','no_view_full_size'))) {
$include_link = false;
}
$a = get_app();
@ -563,38 +565,41 @@ function scale_external_images($srctext, $include_link = true, $scale_replace =
$matches = null;
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
if($c) {
if ($c) {
require_once('include/Photo.php');
foreach($matches as $mtch) {
foreach ($matches as $mtch) {
logger('scale_external_image: ' . $mtch[1]);
$hostname = str_replace('www.','',substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')+3));
if(stristr($mtch[1],$hostname))
if (stristr($mtch[1],$hostname)) {
continue;
}
// $scale_replace, if passed, is an array of two elements. The
// first is the name of the full-size image. The second is the
// name of a remote, scaled-down version of the full size image.
// This allows Friendica to display the smaller remote image if
// one exists, while still linking to the full-size image
if($scale_replace)
if ($scale_replace) {
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[1]);
else
} else {
$scaled = $mtch[1];
$i = @fetch_url($scaled);
if(! $i)
}
$i = fetch_url($scaled);
if (! $i) {
return $srctext;
}
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
if($i) {
if ($i) {
$ph = new Photo($i, $type);
if($ph->is_valid()) {
if ($ph->is_valid()) {
$orig_width = $ph->getWidth();
$orig_height = $ph->getHeight();
if($orig_width > 640 || $orig_height > 640) {
if ($orig_width > 640 || $orig_height > 640) {
$ph->scaleImage(640);
$new_width = $ph->getWidth();
@ -620,7 +625,7 @@ function scale_external_images($srctext, $include_link = true, $scale_replace =
function fix_contact_ssl_policy(&$contact,$new_policy) {
$ssl_changed = false;
if((intval($new_policy) == SSL_POLICY_SELFSIGN || $new_policy === 'self') && strstr($contact['url'],'https:')) {
if ((intval($new_policy) == SSL_POLICY_SELFSIGN || $new_policy === 'self') && strstr($contact['url'],'https:')) {
$ssl_changed = true;
$contact['url'] = str_replace('https:','http:',$contact['url']);
$contact['request'] = str_replace('https:','http:',$contact['request']);
@ -630,7 +635,7 @@ function fix_contact_ssl_policy(&$contact,$new_policy) {
$contact['poco'] = str_replace('https:','http:',$contact['poco']);
}
if((intval($new_policy) == SSL_POLICY_FULL || $new_policy === 'full') && strstr($contact['url'],'http:')) {
if ((intval($new_policy) == SSL_POLICY_FULL || $new_policy === 'full') && strstr($contact['url'],'http:')) {
$ssl_changed = true;
$contact['url'] = str_replace('http:','https:',$contact['url']);
$contact['request'] = str_replace('http:','https:',$contact['request']);
@ -640,15 +645,15 @@ function fix_contact_ssl_policy(&$contact,$new_policy) {
$contact['poco'] = str_replace('http:','https:',$contact['poco']);
}
if($ssl_changed) {
q("update contact set
url = '%s',
request = '%s',
notify = '%s',
poll = '%s',
confirm = '%s',
poco = '%s'
where id = %d limit 1",
if ($ssl_changed) {
q("UPDATE `contact` SET
`url` = '%s',
`request` = '%s',
`notify` = '%s',
`poll` = '%s',
`confirm` = '%s',
`poco` = '%s'
WHERE `id` = %d LIMIT 1",
dbesc($contact['url']),
dbesc($contact['request']),
dbesc($contact['notify']),


+ 24
- 21
include/plugin.php View File

@ -129,7 +129,7 @@ function reload_plugins() {
*/
function plugin_enabled($plugin) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
return((bool)(count($r) > 0));
return ((dbm::is_result($r)) && (count($r) > 0));
}
@ -413,7 +413,7 @@ function get_theme_info($theme){
function get_theme_screenshot($theme) {
$exts = array('.png','.jpg');
foreach($exts as $ext) {
if(file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
if (file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
return(App::get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext);
}
}
@ -425,8 +425,8 @@ if (! function_exists('uninstall_theme')){
function uninstall_theme($theme){
logger("Addons: uninstalling theme " . $theme);
@include_once("view/theme/$theme/theme.php");
if(function_exists("{$theme}_uninstall")) {
include_once("view/theme/$theme/theme.php");
if (function_exists("{$theme}_uninstall")) {
$func = "{$theme}_uninstall";
$func();
}
@ -436,19 +436,19 @@ if (! function_exists('install_theme')){
function install_theme($theme) {
// silently fail if theme was removed
if(! file_exists("view/theme/$theme/theme.php"))
if (! file_exists("view/theme/$theme/theme.php")) {
return false;
}
logger("Addons: installing theme $theme");
@include_once("view/theme/$theme/theme.php");
include_once("view/theme/$theme/theme.php");
if(function_exists("{$theme}_install")) {
if (function_exists("{$theme}_install")) {
$func = "{$theme}_install";
$func();
return true;
}
else {
} else {
logger("Addons: FAILED installing theme $theme");
return false;
}
@ -467,10 +467,9 @@ function install_theme($theme) {
function service_class_allows($uid,$property,$usage = false) {
if($uid == local_user()) {
if ($uid == local_user()) {
$service_class = $a->user['service_class'];
}
else {
} else {
$r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
@ -478,18 +477,23 @@ function service_class_allows($uid,$property,$usage = false) {
$service_class = $r[0]['service_class'];
}
}
if(! x($service_class))
return true; // everything is allowed
if (! x($service_class)) {
// everything is allowed
return true;
}
$arr = get_config('service_class',$service_class);
if(! is_array($arr) || (! count($arr)))
if (! is_array($arr) || (! count($arr))) {
return true;
}
if($usage === false)
if ($usage === false) {
return ((x($arr[$property])) ? (bool) $arr['property'] : true);
else {
if(! array_key_exists($property,$arr))
} else {
if (! array_key_exists($property,$arr)) {
return true;
}
return (((intval($usage)) < intval($arr[$property])) ? true : false);
}
}
@ -497,10 +501,9 @@ function service_class_allows($uid,$property,$usage = false) {
function service_class_fetch($uid,$property) {
if($uid == local_user()) {
if ($uid == local_user()) {
$service_class = $a->user['service_class'];
}
else {
} else {
$r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);


+ 1
- 1
include/poller.php View File

@ -213,7 +213,7 @@ function poller_max_connections_reached() {
// The processlist only shows entries of the current user
if ($max != 0) {
$r = q("SHOW PROCESSLIST");
if (!$r)
if (!dbm::is_result($r))
return false;
$used = count($r);


+ 2
- 2
include/queue.php View File

@ -127,7 +127,7 @@ function queue_run(&$argv, &$argc){
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($qi[0]['cid'])
);
if(! count($c)) {
if (! dbm::is_result($c)) {
remove_queue_item($q_item['id']);
continue;
}
@ -157,7 +157,7 @@ function queue_run(&$argv, &$argc){
FROM `user` WHERE `uid` = %d LIMIT 1",
intval($c[0]['uid'])
);
if(! count($u)) {
if (! dbm::is_result($u)) {
remove_queue_item($q_item['id']);
continue;
}


+ 3
- 2
include/socgraph.php View File

@ -220,8 +220,9 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
$r = q("SELECT `network` FROM `contact` WHERE `nurl` = '%s' AND `network` != '' AND `network` != '%s' LIMIT 1",
dbesc(normalise_link($profile_url)), dbesc(NETWORK_STATUSNET)
);
if (dbm::is_result($r))
if (dbm::is_result($r)) {
$network = $r[0]["network"];
}
if (($network == "") OR ($network == NETWORK_OSTATUS)) {
$r = q("SELECT `network`, `url` FROM `contact` WHERE `alias` IN ('%s', '%s') AND `network` != '' AND `network` != '%s' LIMIT 1",
@ -1575,7 +1576,7 @@ function get_gcontact_id($contact) {
proc_run(PRIORITY_LOW, 'include/gprobe.php', bin2hex($contact["url"]));
}
if ((count($r) > 1) AND ($gcontact_id > 0) AND ($contact["url"] != ""))
if ((dbm::is_result($r)) AND (count($r) > 1) AND ($gcontact_id > 0) AND ($contact["url"] != ""))
q("DELETE FROM `gcontact` WHERE `nurl` = '%s' AND `id` != %d",
dbesc(normalise_link($contact["url"])),
intval($gcontact_id));


+ 1
- 1
include/text.php View File

@ -369,7 +369,7 @@ if(! function_exists('paginate')) {
* @param App $a App instance
* @return string html for pagination #FIXME remove html
*/
function paginate(&$a) {
function paginate(App &$a) {
$data = paginate_data($a);
$tpl = get_markup_template("paginate.tpl");


+ 9
- 6
include/user.php View File

@ -241,7 +241,7 @@ function create_user($arr) {
WHERE `nickname` = '%s' ",
dbesc($nickname)
);
if((count($r) > 1) && $newuid) {
if ((dbm::is_result($r)) && (count($r) > 1) && $newuid) {
$result['message'] .= t('Nickname is already registered. Please choose another.') . EOL;
q("DELETE FROM `user` WHERE `uid` = %d",
intval($newuid)
@ -262,7 +262,7 @@ function create_user($arr) {
intval($netpublish)
);
if($r === false) {
if ($r === false) {
$result['message'] .= t('An error occurred creating your default profile. Please try again.') . EOL;
// Start fresh next time.
$r = q("DELETE FROM `user` WHERE `uid` = %d",
@ -325,24 +325,27 @@ function create_user($arr) {
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4 );
if($r === false)
if ($r === false) {
$photo_failure = true;
}
$img->scaleImage(80);
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 5 );
if($r === false)
if ($r === false) {
$photo_failure = true;
}
$img->scaleImage(48);
$r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 6 );
if($r === false)
if ($r === false) {
$photo_failure = true;
}
if(! $photo_failure) {
if (! $photo_failure) {
q("UPDATE `photo` SET `profile` = 1 WHERE `resource-id` = '%s' ",
dbesc($hash)
);


+ 23
- 28
library/spam/b8/storage/storage_frndc.php View File

@ -123,15 +123,17 @@ class b8_storage_frndc extends b8_storage_base
function __destruct()
{
if($this->_connection === NULL)
if ($this->_connection === NULL) {
return;
}
# Commit any changes before closing
// Commit any changes before closing
$this->_commit();
# Just close the connection if no link-resource was passed and b8 created it's own connection
if($this->config['connection'] === NULL)
// Just close the connection if no link-resource was passed and b8 created it's own connection
if ($this->config['connection'] === NULL) {
mysql_close($this->_connection);
}
$this->connected = FALSE;
@ -163,9 +165,8 @@ class b8_storage_frndc extends b8_storage_base
protected function _get_query($tokens, $uid)
{
# Construct the query ...
if(count($tokens) > 0) {
// Construct the query ...
if (count($tokens) > 0) {
$where = array();
@ -175,42 +176,42 @@ class b8_storage_frndc extends b8_storage_base
}
$where = 'term IN ("' . implode('", "', $where) . '")';
}
else {
} else {
$token = dbesc($token);
$where = 'term = "' . $token . '"';
}
# ... and fetch the data
// ... and fetch the data
$result = q('
SELECT * FROM spam WHERE ' . $where . ' AND uid = ' . $uid );
$result = q('SELECT * FROM `spam` WHERE ' . $where . ' AND `uid` = ' . $uid );
$returned_tokens = array();
if(count($result)) {
foreach($result as $rr)
if (dbm::is_result($result)) {
foreach ($result as $rr) {
$returned_tokens[] = $rr['term'];
}
}
$to_create = array();
if(count($tokens) > 0) {
if (count($tokens) > 0) {
foreach($tokens as $token)
if(! in_array($token,$returned_tokens))
$to_create[] = str_tolower($token);
}
if(count($to_create)) {
if (count($to_create)) {
$sql = '';
foreach($to_create as $term) {
if(strlen($sql))
foreach ($to_create as $term) {
if (strlen($sql)) {
$sql .= ',';
$sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)",
dbesc(str_tolower($term))
}
$sql .= sprintf("(`term`,`datetime`,`uid`) VALUES('%s','%s',%d)",
dbesc(str_tolower($term)),
dbesc(datetime_convert()),
intval($uid)
);
q("insert into spam " . $sql);
}
q("INSERT INTO `spam` " . $sql);
}
return $result;
@ -225,7 +226,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $count
* @return void
*/
protected function _put($token, $count, $uid) {
$token = dbesc($token);
$count = dbesc($count);
@ -241,7 +241,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $count
* @return void
*/
protected function _update($token, $count, $uid)
{
$token = dbesc($token);
@ -257,7 +256,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $token
* @return void
*/
protected function _del($token, $uid)
{
$token = dbesc($token);
@ -272,7 +270,6 @@ class b8_storage_frndc extends b8_storage_base
* @access protected
* @return void
*/
protected function _commit($uid)
{
@ -314,5 +311,3 @@ class b8_storage_frndc extends b8_storage_base
}
}
?>

+ 3
- 2
mod/_well_known.php View File

@ -1,8 +1,9 @@
<?php
/// @TODO This file has DOS line endings!
require_once("mod/hostxrd.php");
require_once("mod/nodeinfo.php");
function _well_known_init(&$a){
function _well_known_init(App &$a){
if ($a->argc > 1) {
switch($a->argv[1]) {
case "host-meta":
@ -20,7 +21,7 @@ function _well_known_init(&$a){
killme();
}
function wk_social_relay(&$a) {
function wk_social_relay(App &$a) {
define('SR_SCOPE_ALL', 'all');
define('SR_SCOPE_TAGS', 'tags');