You are here

function bueditor_check_match in BUEditor 5

Same name and namespace in other branches
  1. 6.2 bueditor.inc \bueditor_check_match()
  2. 6 bueditor.module \bueditor_check_match()
  3. 7 bueditor.inc \bueditor_check_match()

Check matching lines of the needle in haystack.(page and textarea id)

1 call to bueditor_check_match()
bueditor_textarea in ./bueditor.module
Integrate the editor into textareas.

File

./bueditor.module, line 599

Code

function bueditor_check_match($needle, $haystack) {
  $needle = '/^' . preg_replace("/\r\n?|\n/", '|', str_replace(array(
    '*',
    '-',
    '/',
  ), array(
    '.*',
    '\\-',
    '\\/',
  ), trim($needle))) . '$/';
  return preg_match($needle, $haystack);
}