bugBibORB - Bugs: bug #18456, HTML Entities remain in exported...

 
 

bug #18456: HTML Entities remain in exported BibTeX

Submitter:  None
Submitted:  Tue 05 Dec 2006 08:14:31 AM UTC
   
 
Category:  Misc Severity:  3 - Normal
Item Group:  Errors Status:  In Progress
Assigned to:  ggardey Open/Closed:  Open
Release:  * 1.3.3 Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 06 Mar 2007 09:41:48 PM UTC, comment #1: 

For PHP 4 >= 4.3.0, PHP 5, one can also use html_entity_decode.

Guillaume Gardey <ggardey>
Group administrator
Tue 05 Dec 2006 08:14:31 AM UTC, original submission:  

On storing entries in the XML database, the characters &lt;, &gt;, and &amp; are replaced by the entities &amp;lt;, &amp;gt;, and &amp;amp; (which is fine). But when the entries are exported to BibTeX, one does not wish to see these HTML entities but the original characters as they were entered by the user.

I added a new function

<pre>
function undohtmlentities($str){
    $patterns = array('&amp;','&lt;','&gt;');
    $replace = array('&','<','>');
    return str_replace($patterns,$replace,$str);
}
</pre>

in utilities.php and changed line 184 in bibtex.php to
<pre>
$ref_tab[$fields[1][$j]]=trim(undohtmlentities($fields[2][$j]));
</pre>

This fixes the problem but there might be some security risks, when entry strings are displayed as part of an html result.


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ggardey (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-03-06 ggardey StatusNone In Progress
        Assigned toNone ggardey

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code