It definitely needs to be $p not $pp. The problem though is case
sensitivity. I set up a test installation, and found the following
slight change seems to work:
function BOLTinfoClean($info, $args, $target='') {
$before = count($info);
$exists = implode(',', BOLTsearchPageList(Array()));
foreach ($info as $p => $v) {
$pp = strtolower(BOLTutf2url($p));
if (strpos(",$exists,", ",$pp,") === false) unset($info[$p]);
else $out .= "$p: $v\n";
}
$after = count($info);
BOLTsavepage($target, $out);
return "Info fields cleaned.\nBefore: $before, After: $after.";
}
Note the strtolower around the $pp value. That enables the proper
files to be recognized as existing. Making sure you have $p instead of
$pp makes sure the files that don't exist get deleted.
I probably should add this strtolower to the utf2url function, but I'm
not sure what the implications would be. So for now let's leave well
enough alone. :)
Cheers,
Dan
--
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.