How about changing the code to this. Note the asterisks for the changed lines:

function BOLTinfoClean($info, $args) {
        $before = count($info);
        $exists = implode(',', BOLTsearchPageList(Array()));
        foreach ($info as $p => $v) {
**              $pp = BOLTutf2url($p);
**              if (strpos(",$exists,", ",$pp,") === false) unset($info[$p]);
                }
        $after = count($info);
        return "Info fields cleaned.\nBefore: $before, After: $after.";
        }

If this helps let me know and I will update the plugin. I haven't tested it....

Cheers,
Dan


On Mon, Apr 19, 2010 at 5:28 AM, Phoenix Wu <[email protected]> wrote:
> I found a solution in this extension -- infox(info extension)
> http://www.boltwire.com/index.php?p=solutions.system.infox
>
> There is a build-in clean function should be working.
> function BOLTinfoClean($info, $args) {
>        $before = count($info);
>        $exists = implode(',', BOLTsearchPageList(Array()));
>        foreach ($info as $p => $v) {
>                if (strpos(",$exists,", ",$p,") === false) unset($info[$p]);
>                }
>        $after = count($info);
>        return "Info fields cleaned.\nBefore: $before, After: $after.";
>        }
> But it seems have the unicode(utf-8) problem?
> The return of strpos() will be wrong if the entry in info.tags
> contains Chinese or Parentheses ()
> Try to use mb_strpos() instead but still not working...

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en.

Reply via email to