diff options
author | marijus <mario@localhost.localdomain> | 2014-02-05 14:48:42 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2014-02-05 14:48:42 +0100 |
commit | 419e3b5024efec40c98e48c3bf213c4e60d39fae (patch) | |
tree | d3754aa1d251308eb6178fe4ab138463ceaaf135 /include/spam.php | |
parent | d7d2fff24b05bcb3ff3acc215e99f8f7d33d058d (diff) | |
parent | 0844110f7b154a0fb5102362fe732c2b091222d7 (diff) | |
download | volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.gz volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.bz2 volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.zip |
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'include/spam.php')
-rw-r--r-- | include/spam.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/spam.php b/include/spam.php new file mode 100644 index 000000000..8b158b7ae --- /dev/null +++ b/include/spam.php @@ -0,0 +1,35 @@ +<?php /** @file */ + + +function string_splitter($s) { + + if(! $s) + return array(); + + $s = preg_replace('/\pP+/','',$s); + + $x = mb_split("\[|\]|\s",$s); + + $ret = array(); + if($x) { + foreach($x as $y) { + if(mb_strlen($y) > 2) + $ret[] = substr($y,0,64); + } + } + return $ret; +} + + + +function get_words($uid,$list) { + + stringify($list,true); + + $r = q("select * from spam where term in ( " . $list . ") and uid = %d", + intval($uid) + ); + + return $r; +} + |