aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-20 19:33:42 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-20 19:33:42 -0700
commitd87c7ceeb03a348526cd2f8bb5643b13a1860b40 (patch)
tree9fd354f4b13f20c780bb6a74ee25602025825b76
parent9495d2c7014b7e8a943ecf72798c40bce9a10a96 (diff)
downloadvolse-hubzilla-d87c7ceeb03a348526cd2f8bb5643b13a1860b40.tar.gz
volse-hubzilla-d87c7ceeb03a348526cd2f8bb5643b13a1860b40.tar.bz2
volse-hubzilla-d87c7ceeb03a348526cd2f8bb5643b13a1860b40.zip
there is no stricmp() in php, use strcasecmp() - also only detect language if we plan to use it.
-rwxr-xr-xinclude/items.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index a460c8fd2..5e84944a4 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3381,7 +3381,10 @@ function post_is_importable($item,$abook) {
$text = prepare_text($item['body'],$item['mimetype']);
$text = html2plain($text);
- $lang = detect_language($text);
+ $lang = null;
+
+ if((strpos($abook['abook_incl'],'lang=') !== false) || (strpos($abook['abook_incl'],'lang=') !== false))
+ $lang = detect_language($text);
$tags = ((count($item['term'])) ? $item['term'] : false);
@@ -3399,7 +3402,7 @@ function post_is_importable($item,$abook) {
}
elseif((strpos($word,'/') === 0) && preg_match($word,$body))
return false;
- elseif((strpos($word,'lang=') === 0) && ($lang) && (stricmp($lang,trim(substr($word,5))) == 0))
+ elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return false;
elseif(stristr($text,$word) !== false)
return false;
@@ -3418,7 +3421,7 @@ function post_is_importable($item,$abook) {
}
elseif((strpos($word,'/') === 0) && preg_match($word,$body))
return true;
- elseif((strpos($word,'lang=') === 0) && ($lang) && (stricmp($lang,trim(substr($word,5))) == 0))
+ elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return true;
elseif(stristr($text,$word) !== false)
return true;