aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-05-26 12:06:19 +0200
committerMichael <icarus@dabo.de>2012-05-26 12:06:19 +0200
commit817fc37f41c030381507384db581f62d9a1b5044 (patch)
treec152def3537eb41e933e8ad537085af6abeb91cd /include/api.php
parent7b3c02057db47a627b56bdd79f1055ea7f876617 (diff)
parenta5dc41ab131d4235eb947ff00d7af0593bf0e460 (diff)
downloadvolse-hubzilla-817fc37f41c030381507384db581f62d9a1b5044.tar.gz
volse-hubzilla-817fc37f41c030381507384db581f62d9a1b5044.tar.bz2
volse-hubzilla-817fc37f41c030381507384db581f62d9a1b5044.zip
Merge branch 'master' of github.com:annando/friendica
Conflicts: mod/network.php
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/api.php b/include/api.php
index f58a91a72..5697fbdbc 100644
--- a/include/api.php
+++ b/include/api.php
@@ -976,7 +976,7 @@
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
-
+
$start = $page*$count;
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
@@ -985,11 +985,19 @@
$myurl = substr($myurl,strpos($myurl,'://')+3);
$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
$diasp_url = str_replace('/profile/','/u/',$myurl);
- $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' or tag regexp '%s' )) ",
- dbesc($myurl . '$'),
- dbesc($myurl . '\\]'),
- dbesc($diasp_url . '\\]')
- );
+
+ if (get_config('system','use_fulltext_engine'))
+ $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ",
+ dbesc(protect_sprintf($myurl)),
+ dbesc(protect_sprintf($myurl)),
+ dbesc(protect_sprintf($diasp_url))
+ );
+ else
+ $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ",
+ dbesc(protect_sprintf('%' . $myurl)),
+ dbesc(protect_sprintf('%' . $myurl . '\\]%')),
+ dbesc(protect_sprintf('%' . $diasp_url . '\\]%'))
+ );
if ($max_id > 0)
$sql_extra .= ' AND `item`.`id` <= '.intval($max_id);