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

 
 

bug #18456: HTML Entities remain in exported BibTeX

Submitted by:  None
Submitted on:  Tue 05 Dec 2006 08:14:31 AM UTC  
 
Category: MiscSeverity: 3 - Normal
Item Group: ErrorsStatus: In Progress
Assigned to: Guillaume Gardey <ggardey>Open/Closed: Open
Release: 1.3.3Fixed Release: None
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Mar 2007 09:41:48 PM UTCggardeyStatusNone=>In Progress
      Assigned toNone=>ggardey

    Back to the top


    Powered by Savane 3.1-cleanup1