Menu

Textarea htmlspecialchars

Developers
AcornsN64
2009-09-22
2013-04-29
  • AcornsN64

    AcornsN64 - 2009-09-22

    In:
    code/edit/file.php

    File are loaded using file_get_contents. The results of this function are then directly popped into a <textarea></textarea>. If the file contains </textarea> it will close the editor textarea, and print the rest of the contents are html. This can be fixed by using htmlspecialchars on the contents of the file.

    echo '
    <textarea id="editarea" name="content" style="width: 100%; height: 100%; padding: 0px; margin: 0px;">'.trim ( htmlspecialchars( $main ) ).'</textarea>';

     
  • QL Studio

    QL Studio - 2009-09-22

    @ acornsn64 - Thanks for the code - not an issue I'd hit.. but sure you're not to the first to see this..

    I've got a number of small fixes to add, so will try to get these all in a release soon.

    thanks again and good luck

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.