Hello,

I send you some little fixes that I’ve added in order to handle special characters when browsing by author and when displaying the preview view of an image:

 

1) Browse by Author functionality: if the author name contains special characters like & ‘, it is not possible to browse this author, since its content is passed in the url and the url is corrupted.  This problem can be fixed by adding |escape:”url” when setting the author value in the url.

 

In file fez/templates/en/list_form.tpl.html:

[Original]: <a href='{$rel_url}list.php?browse=author&author={$list[i].record_author}'>{$list[i].record_author|escape:"html"}</a> ({$list[i].record_count|escape:"html"})

[Modified]: <a href='{$rel_url}list.php?browse=author&author={$list[i].record_author|escape:"url"}'>{$list[i].record_author|escape:"html"}</a> ({$list[i].record_count|escape:"html"})

 

In file fez/templates/en/stats_form.tpl.html:

[Original]: <a href='{$rel_url}list.php?browse=author&author={$list[i].record_author}'>{$list[i].record_author|escape:"html"}</a>

[Modified]: <a href='{$rel_url}list.php?browse=author&author={$list[i].record_author|escape:"url"}'>{$list[i].record_author|escape:"html"}</a>

 

2) Load image preview functionality: if the image description (label attribute) contains ‘ character, the javascript function loadPreview doesn’t work.  This problem can be fixed by adding  |escape:"html" when passing the label value to the method.

 

In file fez/templates/en/view_form.tpl.html:

[Original]: {if $datastreams[d].canPreview || $isAdministrator}onclick="javascript:loadPreview('{$pid}','{$datastreams[d].preview}', '{$datastreams[d].label}');"{/if}

[Modified]: {if $datastreams[d].canPreview || $isAdministrator}onclick="javascript:loadPreview('{$pid}','{$datastreams[d].preview}', '{$datastreams[d].label|escape:"html"}');"{/if}

[Original]: <script language="JavaScript">loadPreview('{$pid}','{$preview_ds_1.preview}','{$preview_ds_1.label}');</script>

[Modified]: <script language="JavaScript">loadPreview('{$pid}','{$preview_ds_1.preview}','{$preview_ds_1.label|escape:"html"}');</script>

 

Best Regards,

Leire Urcelay