<commit_before><?php
/**
 * 
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2014, Xoff Software GmbH
 * @license MIT
 * @version 1.0
 * @package epesi-notify
 * 
 */

ob_start();
define('CID',$_REQUEST['cid']);
require_once('../../../include.php');
ModuleManager::load_modules();

if(!Base_AclCommon::is_user())
exit();

$general_setting = Base_NotifyCommon::get_general_setting();

if ($general_setting == -1) {
	echo json_encode(array('disable'=>1));
	exit();
}

$ret = null;
$notify_count = 0;
$group_similar = Base_NotifyCommon::group_similar();
$notifications = Base_NotifyCommon::get_notifications();

foreach ($notifications as $module=>$notify) {
	$timeout = Base_NotifyCommon::get_module_setting($module);
	if ($timeout == -1) continue;

	$msg_count = 0;
	$new_messages = Base_NotifyCommon::get_new_messages($module, $notify['tray']);
	foreach ($new_messages as $id=>$message) {
		$msg_count++;
		if (!$group_similar) {
			$notify_count++;
			if ($notify_count>Base_NotifyCommon::message_refresh_limit) break;
		}

		$_SESSION['Base_Notify']['notified_cache'][$module][$id] = 1;
		
		if ($group_similar && count($new_messages) >1) continue;

		$title = EPESI.' '.Base_NotifyCommon::strip_html($message['title']);
		$body = Base_NotifyCommon::strip_html($message['body']);
		$icon = Base_NotifyCommon::get_icon($module, $message);

		$ret[] = array('title'=>$title, 'opts'=>array('body'=>$body, 'icon'=>$icon), 'timeout'=>$timeout);<commit_msg>Base Notify - fix issue with undefined index<commit_after><?php
/**
 * 
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2014, Xoff Software GmbH
 * @license MIT
 * @version 1.0
 * @package epesi-notify
 * 
 */

ob_start();
define('CID',$_REQUEST['cid']);
require_once('../../../include.php');
ModuleManager::load_modules();

if(!Base_AclCommon::is_user())
exit();

$general_setting = Base_NotifyCommon::get_general_setting();

if ($general_setting == -1) {
	echo json_encode(array('disable'=>1));
	exit();
}

$ret = null;
$notify_count = 0;
$group_similar = Base_NotifyCommon::group_similar();
$notifications = Base_NotifyCommon::get_notifications();

foreach ($notifications as $module => $notify) {
    if (!isset($notify['tray'])) continue;
	$timeout = Base_NotifyCommon::get_module_setting($module);
	if ($timeout == -1) continue;

	$msg_count = 0;
	$new_messages = Base_NotifyCommon::get_new_messages($module, $notify['tray']);
	foreach ($new_messages as $id=>$message) {
		$msg_count++;
		if (!$group_similar) {
			$notify_count++;
			if ($notify_count>Base_NotifyCommon::message_refresh_limit) break;
		}

		$_SESSION['Base_Notify']['notified_cache'][$module][$id] = 1;
		
		if ($group_similar && count($new_messages) >1) continue;

		$title = EPESI.' '.Base_NotifyCommon::strip_html($message['title']);
		$body = Base_NotifyCommon::strip_html($message['body']);
		$icon = Base_NotifyCommon::get_icon($module, $message);

		$ret[] = array('title'=>$title, 'opts'=>array('body'=>$body, 'icon'=>$icon), 'timeout'=>$timeout);
{'fraction_non_alphanumeric': 0.19973368841544606, 'fraction_numerical': 0.008655126498002663, 'mean_word_length': 6.665816326530612, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '644751', 'n_tokens_mistral': 1066, 'n_tokens_neox': 999, 'n_words': 179}