function _watchdog_triggers_preg_match_patterns in Logging and alerts 7
Same name and namespace in other branches
- 6.2 watchdog_triggers/watchdog_triggers.module \_watchdog_triggers_preg_match_patterns()
- 6 watchdog_triggers/watchdog_triggers.module \_watchdog_triggers_preg_match_patterns()
- 7.2 watchdog_triggers/watchdog_triggers.module \_watchdog_triggers_preg_match_patterns()
Helper function, preg_matches contents of an array.
1 call to _watchdog_triggers_preg_match_patterns()
- watchdog_triggers_watchdog in watchdog_triggers/
watchdog_triggers.module - Implements hook_watchdog().
File
- watchdog_triggers/
watchdog_triggers.module, line 270 - Provides a Trigger and Action integration for watchdog events.
Code
function _watchdog_triggers_preg_match_patterns($array, $target) {
$match_results = FALSE;
foreach ($array as $pattern) {
$pattern = trim($pattern);
$matches = array();
if (!empty($pattern)) {
$number_matches = preg_match_all($pattern, $target, $matches);
if ($number_matches > 0 && $number_matches !== FALSE) {
$match_results = TRUE;
}
}
}
return $match_results;
}