diff options
author | friendica <info@friendica.com> | 2014-02-02 21:25:52 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-02-02 21:25:52 -0800 |
commit | ee42079685dd4df721b1090bdaa0d86316e3358a (patch) | |
tree | c17bcc246b68dd4a53b7883f81f596f82cc1e3fc /include/spam.php | |
parent | c7cad26b4187736065d02876c3a260309a5c6691 (diff) | |
download | volse-hubzilla-ee42079685dd4df721b1090bdaa0d86316e3358a.tar.gz volse-hubzilla-ee42079685dd4df721b1090bdaa0d86316e3358a.tar.bz2 volse-hubzilla-ee42079685dd4df721b1090bdaa0d86316e3358a.zip |
The problem with a lot of packages is that it's easier to re-write them than to re-use them.
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; +} + |