Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Encoding special characters not in htmlspecialchars()

phpMyEdit General     Encoding special characters not in htmlspecialchars()
Post new topic   Reply to topic    
 
plemieux     Joined: 11 May 2005   Posts: 20  
Post Posted: 2005-09-16 22:15
Back to top  Reply with quote     

I'd like to encode some special characters not covered by htmlspecialchars() function.

I would like to apply the following function to all text fields:

Code:
function CleanupSmartQuotes($text) {
   $badwordchars=array(
      chr(145), //lsquo
      chr(146), //rsquo
      chr(147), //ldquo
      chr(148), //rdquo
      chr(151)  //mdash
   );
   $fixedwordchars=array(
      "‘",
      "’",
      '“',
      '”',
      '—'
   );
   return str_replace($badwordchars,$fixedwordchars,$text);
}


Do I need to modify PME class? If so, what part do I need to modify?

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy