tas2580 / seourls

phpBB Extension: URL rewriting for phpBB forums
https://tas2580.net/downloads/phpbb-seo-url/
GNU General Public License v2.0
44 stars 25 forks source link

Attachment filetype images are broken #35

Closed HanPrower closed 6 years ago

HanPrower commented 7 years ago

The attachment filetype images are broken due to looking for them in ./images (by default).

I wrote a terrible fix for it (which has issues): 'core.parse_attachments_modify_template_data' => 'parse_attachments_modify_template_data',

    /**
     * Correct the path of attachment images
     *
     * @param   object  $event  The event object
     * @return  null
     * @access  public
     */
    public function parse_attachments_modify_template_data($event)
    {
        $loc = $this->request->server('REQUEST_URI');
        if (!strpos($loc, 'viewtopic'.$this->php_ext)) {
            $block_array = $event['block_array'];
            $block_array['UPLOAD_ICON'] = str_replace('img src=".', 'img src="..', $block_array['UPLOAD_ICON']);
            $event['block_array'] = $block_array;
        }
    }
tas2580 commented 6 years ago

Images should go over download/file.php?id=123

HanPrower commented 6 years ago

@tas2580 what do you mean by that?

You haven't presented a fix to the issue that the icons that show the filetype of an attachment are broken when using this extension.

This icon: image