Merge branch 'rewrites/dbm_is_result' of github.com:Quix0r/friendica into rewrites/dbm_is_result

Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	include/Photo.php
	include/api.php
	include/cache.php
	include/dbstructure.php
	include/enotify.php
	include/items.php
	include/onepoll.php
	include/queue_fn.php
	include/session.php
	include/text.php
	mod/contacts.php
	mod/dfrn_request.php
	mod/display.php
	mod/events.php
	mod/item.php
	mod/message.php
	mod/msearch.php
	mod/photos.php
	mod/poco.php
	mod/profile.php
	mod/proxy.php
	mod/videos.php
	update.php
	view/theme/diabook/theme.php
	view/theme/vier/theme.php
This commit is contained in:
Roland Häder 2016-12-13 11:00:44 +01:00
commit 63610c7b73
33 changed files with 320 additions and 260 deletions

View file

@ -273,7 +273,7 @@ function dfrn_request_post(&$a) {
dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
intval($uid)
);
if(dbm::is_result($r) > $maxreq) {
if(dbm::is_result($r) && count($r) > $maxreq) {
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
notice( t('Spam protection measures have been invoked.') . EOL);
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
@ -370,8 +370,8 @@ function dfrn_request_post(&$a) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if(! dbm::is_result($r)) {
if(! dbm::is_result($r)) {
notice( t('This account has not been configured for email. Request failed.') . EOL);
return;
}
@ -431,8 +431,8 @@ function dfrn_request_post(&$a) {
$hash = random_string();
$r = q("insert into intro ( uid, `contact-id`, knowyou, note, hash, datetime, blocked )
values( %d , %d, %d, '%s', '%s', '%s', %d ) ",
$r = q("INSERT INTO intro ( uid, `contact-id`, knowyou, note, hash, datetime, blocked )
VALUES( %d , %d, %d, '%s', '%s', '%s', %d ) ",
intval($uid),
intval($contact_id),
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
@ -449,9 +449,13 @@ function dfrn_request_post(&$a) {
$data = probe_url($url);
$network = $data["network"];
logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - BEFORE!', LOGGER_DEBUG);
// Canonicalise email-style profile locator
$url = Probe::webfinger_dfrn($url,$hcard);
logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - AFTER!', LOGGER_DEBUG);
if (substr($url,0,5) === 'stat:') {
// Every time we detect the remote subscription we define this as OStatus.
@ -473,7 +477,7 @@ function dfrn_request_post(&$a) {
dbesc($url)
);
if(count($ret)) {
if(dbm::is_result($ret)) {
if(strlen($ret[0]['issued-id'])) {
notice( t('You have already introduced yourself here.') . EOL );
return;
@ -720,7 +724,9 @@ function dfrn_request_content(&$a) {
dbesc($_GET['confirm_key'])
);
if(count($intro)) {
if(dbm::is_result($intro)) {
$auto_confirm = false;
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`id` = %d LIMIT 1",