diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-07-21 17:13:48 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-07-21 17:13:48 -0700 |
commit | c90f14c066d0f289bd2220bb66325db12700aa57 (patch) | |
tree | 6c915ad03936d479d1d807540bbc0e7ae0f854ad /include/items.php | |
parent | 24ec104819bbc3778a159ea4790398988a6e2fd7 (diff) | |
parent | 3ec6a431b62c20952f07f889acfeedd0ac456d04 (diff) | |
download | volse-hubzilla-c90f14c066d0f289bd2220bb66325db12700aa57.tar.gz volse-hubzilla-c90f14c066d0f289bd2220bb66325db12700aa57.tar.bz2 volse-hubzilla-c90f14c066d0f289bd2220bb66325db12700aa57.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts:
doc/to_do_code.bb
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index af57e3eda..af76fe203 100755 --- a/include/items.php +++ b/include/items.php @@ -3384,6 +3384,11 @@ function post_is_importable($item,$abook) { $text = prepare_text($item['body'],$item['mimetype']); $text = html2plain($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); // exclude always has priority @@ -3400,6 +3405,8 @@ function post_is_importable($item,$abook) { } elseif((strpos($word,'/') === 0) && preg_match($word,$body)) return false; + elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0)) + return false; elseif(stristr($text,$word) !== false) return false; } @@ -3417,6 +3424,8 @@ function post_is_importable($item,$abook) { } elseif((strpos($word,'/') === 0) && preg_match($word,$body)) return true; + elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0)) + return true; elseif(stristr($text,$word) !== false) return true; } |