01159: EnableNotify may generate repeated emails if not EnableDirectDownload

Summary: EnableNotify may generate repeated emails if not EnableDirectDownload
Created: 2009-12-31 01:16
Status: Closed - workaround
Category: Bug
From: Rik Blok
Assigned:
Priority: 3
Version: 2.2.8
OS: 5.2.11

Description: After enabling notifications I get emailed multiple notifications after each change. The messages are all identical and correct. The only problem is that they are repeats. It appears to occur because I have uploaded images in my pages and I have $EnableDirectDownload=0. So displaying each image with Attach:image.gif spawns a new instance of pmwiki.php before the notification file is wiped. Each instance sees the pending notifications and sends an email.

The issue is probably related to this thread: http://www.pmichaud.com/pipermail/pmwiki-users/2008-February/049073.html.

Workaround

Disabling notifications for downloads seems to workaround this bug:

if ($action != 'download') $EnableNotify=1; // disabled for downloads

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_COOKIE] => PHPSESSID=ili0k0844vi9tb7iuhckqip995; imstime=1777482900
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=PITS%2f01159
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=PITS%2f01159
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/01159
            [REDIRECT_SCRIPT_URL] => /wiki/PITS/01159
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afI8vJ6P9CbotVvkIcl5yAAAAQY
            [REDIRECT_URL] => /wiki/PITS/01159
            [REMOTE_ADDR] => 216.73.216.31
            [REMOTE_PORT] => 50586
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/PITS/01159
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/01159
            [SCRIPT_URL] => /wiki/PITS/01159
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afI8vJ6P9CbotVvkIcl5yAAAAQY
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777482940.9376
            [REQUEST_TIME] => 1777482940
            [argv] => Array
                (
                    [0] => n=PITS%2f01159
                )

            [argc] => 1
        )

)