1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
hubzilla_ynh/sources/.fr-bpZJnx/hubzilla-master/include/spam.php

36 lines
449 B
PHP
Raw Normal View History

2016-06-22 19:56:29 +02:00
<?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;
}