1 --- dokuwiki-2018-04-22c.org/inc/common.php 2022-09-27 22:46:33.691324681 +0200
2 +++ dokuwiki-2018-04-22c/inc/common.php 2022-09-27 22:46:33.924670225 +0200
3 @@ -897,6 +897,34 @@ function gethostsbyaddrs($ips) {
9 + * Returns notify address for page $id
11 + * @param string $id The changed page
12 + * @param mixed $notify The address (string) or rules where to notify
14 + * @author Elan Ruusamäe <glen@delfi.ee>
16 +function notifyNS($id, $notify) {
17 + if (empty($notify)) {
21 + if (is_string($notify)) {
25 + // process $notify for pages
26 + foreach ($notify as $rule => $address) {
27 + if (preg_match('/'.$rule.'/ui',':'.$id)) {
36 * Checks if a given page is currently locked.
38 @@ -1435,10 +1463,10 @@ function notify($id, $who, $rev = '', $s
40 // decide if there is something to do, eg. whom to mail
42 - if(empty($conf['notify'])) return false; //notify enabled?
43 if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $minor) return; //skip minors
45 - $to = $conf['notify'];
46 + $to = notifyNS($id, $conf['notify']);
47 + if(empty($to)) return; //notify enabled?
48 } elseif($who == 'subscribers') {
49 if(!actionOK('subscribe')) return false; //subscribers enabled?
50 if($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
51 --- dokuwiki-2020-07-29a/inc/media.php~ 2022-09-03 19:58:24.000000000 +0300
52 +++ dokuwiki-2020-07-29a/inc/media.php 2023-03-27 11:31:29.468008469 +0300
55 function media_notify($id,$file,$mime,$old_rev=false,$current_rev=false){
57 - if(empty($conf['notify'])) return false; //notify enabled?
58 + $to = notifyNS($id, $conf['notify']);
59 + if(empty($to)) return false; //notify enabled?
61 $subscription = new MediaSubscriptionSender();
62 - return $subscription->sendMediaDiff($conf['notify'], 'uploadmail', $id, $old_rev, $current_rev);
63 + return $subscription->sendMediaDiff($to, 'uploadmail', $id, $old_rev, $current_rev);
67 --- dokuwiki-2020-07-29a/inc/Subscriptions/RegistrationSubscriptionSender.php~ 2022-09-03 19:58:24.000000000 +0300
68 +++ dokuwiki-2020-07-29a/inc/Subscriptions/RegistrationSubscriptionSender.php 2023-03-27 11:37:39.640069460 +0300
70 public function sendRegister($login, $fullname, $email)
73 - if (empty($conf['registernotify'])) {
74 + $to = notifyNS($id, $conf['registernotify']); // XXX $id undefined
83 - $conf['registernotify'],
88 --- dokuwiki-2020-07-29a/./inc/Subscriptions/SubscriberManager.php~ 2022-09-03 19:58:24.000000000 +0300
89 +++ dokuwiki-2020-07-29a/./inc/Subscriptions/SubscriberManager.php 2023-03-27 11:38:57.900505224 +0300
92 $level = auth_aclcheck($id, $user, $userinfo['grps']);
93 if ($level >= AUTH_READ) {
94 - if (strcasecmp($userinfo['mail'], $conf['notify']) != 0) { //skip user who get notified elsewhere
95 + $to = notifyNS($id, $conf['notify']);
96 + if (strcasecmp($userinfo['mail'], $to) != 0) { //skip user who get notified elsewhere
97 $result[$user] = $userinfo['mail'];