- $this->out->element('img', array('class'=>'u-photo', 'src' => $this->attachment->getUrl(), 'alt' => $this->attachment->getTitle()));
+ try {
+ // getUrl(true) because we don't want to hotlink, could be made configurable
+ $this->out->element('img', ['class'=>'u-photo', 'src'=>$this->attachment->getUrl(true), 'alt' => $this->attachment->getTitle()]);
+ } catch (FileNotStoredLocallyException $e) {
+ $url = $e->file->getUrl(false);
+ $this->out->element('a', ['href'=>$url, 'rel'=>'external'], $url);
+ }