Discussion Forums  >  Self Hosted Control Panels

Replies: 2    Views: 71

MDG2
Apple Fan
Profile
Posts: 102
Reg: May 08, 2012
Princeton, New ...
5,020
06/11/12 08:32 AM (13 years ago)

Cpanel adding unwanted character

Why is the Self Hosted Control Panel adding a "" after an apostrophe. Example: I wrote father's (Advanced Menu List Row Title) Control Panel displays it as: father's Discovered the solution at the below thread but my question is why is it adding this character? http://www.buzztouch.com/forum/thread.php?tid=348284F2E48CE74CDC0F4A5&fid=06DB0BCB08E2222&sortColumn=FT.id&sortUpDown=DESC&currentPage=2
 
Known
Apple Fan
Profile
Posts: 83
Reg: Jan 07, 2012
Suttons Bay, Mi...
830
like
06/11/12 08:37 AM (13 years ago)
Gremlins. Every time. It's the gremlins. :)
 
CBungert
Aspiring developer
Profile
Posts: 56
Reg: Jun 17, 2011
Minneapolis
3,310
like
06/18/12 10:09 PM (13 years ago)
I believe its bases on HTML "escaping" characters. Its common to disable certain characters in PHP as a security measure. Since certain characters are seen frequently in HTML and PHP code, something had to be done so that HTML and PHP could differentiate between what is the code it should process, and code written to be displayed. This forum, right now is a great example of this. It allows me to type PHP code in my forum posts, and it is not processed as PHP, just text. Besides escaping there are these other commands called addslashes: __________ string addslashes ( string $str ) <?php $str = "Is your name O'reilly?"; // Outputs: Is your name O\'reilly? echo addslashes($str); ?> __________ And stripslashes: <?php $str = "Is your name O\'reilly?"; // Outputs: Is your name O'reilly? echo stripslashes($str); ?> ______________ The PHP directive magic_quotes_gpc was on by default before PHP 5.4, and it essentially ran addslashes() on all GET, POST, and COOKIE data. Do not use addslashes() on strings that have already been escaped with magic_quotes_gpc as you'll then do double escaping. The function get_magic_quotes_gpc() may come in handy for checking this.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.