Closed (fixed)
Project:
BUEditor
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2009 at 11:37 UTC
Updated:
10 Feb 2010 at 10:03 UTC
I note that my BUEditor ignores pages that he must be enabled. Then i try to hack bueditor_check_match:
function bueditor_check_match($needle, $haystack) {
ea($needle);
$needle = '/^'. preg_replace("/\r\n?|\n/", '|', str_replace(array('*', '-', '/'), array('.*', '\\-', '\\/'), $needle)) .'$/';
ea($needle);
ea($haystack);
ea(preg_match($needle, $haystack));
die();
return preg_match($needle, $haystack);
}ea is my function that dump variable.
It shows:
node/add/blog
node/add/forum
node/add/album
node/add/quotation
node/*
comment/reply/*
comment/edit/*
/^node\/add\/blog|node\/add\/forum|node\/add\/album|node\/add\/quotation|node\/.*|comment\/reply\/.*|comment\/edit\/.*|$/
complain/1005/38429
1
And "|$" force always return 1 on preg_match(). Then i think you code needs a little patch:
$needle = '/^'. preg_replace("/\r\n?|\n/", '$|^', str_replace(array('*', '-', '/'), array('.*', '\\-', '\\/'), $needle)) .'$/';
It works fine for me, but it's need more tests i think.
Comments
Comment #1
ufku commentedyou have an extra empty line below comment/edit/*