diem-project / diem

Diem CMF CMS for symfony 1.4
http://diem-project.org/
MIT License
184 stars 85 forks source link

Wrong path correction in dmMediaTagImage,php #351

Closed artundro closed 13 years ago

artundro commented 13 years ago

On some servers (i.e. home.pl) where _SERVER["DOCUMENT_ROOT"] = '/', attribute src in media helper output html is broken.

now is (at line 227 in dmMediaTagImage,php):

$attributes['src'] = $this->context->getRequest()->getRelativeUrlRoot()
    .str_replace(dmOs::normalize(sfConfig::get('sf_web_dir')), '', dmOs::normalize($mediaFullPath));

my proposal fix:

$attributes['src'] = $this->context->getRequest()->getRelativeUrlRoot()
    .str_replace(dmOs::normalize(sfConfig::get('sf_web_dir')), '/', dmOs::normalize($mediaFullPath));

Greetings Xantas

artundro commented 13 years ago

I work on version 5.1.3