Bad Gallery URL in email notification #563

Open
opened 2026-10-05 00:04:41 +02:00 by adam · 0 comments
Owner

Hello,

I think there is a problem in the url written in the email notification for a new album.
In the general case, it works well. But if you set a gallery_url in the $conf variable, this value is ignored.

If i'm not wrong, the choice of the URL is in the file admin/album_notification.php.

...  
$tpl = array(
    'filename' => 'cat_group_info',
    'assign' => array(
      'IMG' => $img,
      'CAT_NAME' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'),
      'LINK' => make_index_url(
        array(
          'category' => array(
            'id' => $category['id'],
            'name' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'),
            'permalink' => $category['permalink']
            )
          )
        ),
      'CPL_CONTENT' => empty($_POST['mail_content']) ? '' : stripslashes($_POST['mail_content']),
      )
    );
...

The function used to generate the URL is make_index_url that calls get_absolute_root_url. That's fine in the general case, because in that case you want to have the same URL in the notification mail that you used to call the page.

But if you use a reverse proxy, the notification URL will be linked to the call done by the reverse proxy and not by the user. Therefore, the notification URL will be wrong and unusable.

Instead of make_index_url, a function like get_gallery_home_url should be called i think.

Hello, I think there is a problem in the url written in the email notification for a new album. In the general case, it works well. But if you set a `gallery_url` in the `$conf` variable, this value is ignored. If i'm not wrong, the choice of the URL is in the file admin/album_notification.php. ``` ... $tpl = array( 'filename' => 'cat_group_info', 'assign' => array( 'IMG' => $img, 'CAT_NAME' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'), 'LINK' => make_index_url( array( 'category' => array( 'id' => $category['id'], 'name' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'), 'permalink' => $category['permalink'] ) ) ), 'CPL_CONTENT' => empty($_POST['mail_content']) ? '' : stripslashes($_POST['mail_content']), ) ); ... ``` The function used to generate the URL is `make_index_url` that calls `get_absolute_root_url`. That's fine in the general case, because in that case you want to have the same URL in the notification mail that you used to call the page. But if you use a reverse proxy, the notification URL will be linked to the call done by the reverse proxy and not by the user. Therefore, the notification URL will be wrong and unusable. Instead of `make_index_url`, a function like `get_gallery_home_url` should be called i think. <!-- github-sync-id:204432966 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#563