![]() |
Escaping the trademark symbol with MySQL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Escaping the trademark symbol with MySQL (/showthread.php?tid=16372) Pages:
1
2
|
Escaping the trademark symbol with MySQL - El Forum - 03-04-2009 [eluser]TWP Marketing[/eluser] In a sense, Colin, you're correct. I removed the decoding with html_entity_decode(), in my function: read_ds_record(), which fixes the problem. Because this particular view is on the administrative side of my project, I actually WANT to see and edit the encoded text, NOT the parsed text. When I send this same text into my User side view, where it cannot be edited, the decode will work just fine, being done with a different function, displaying the trademark symbol and any other HTML characters that are coded into the db using htmlentities(). Thanks for your help! Escaping the trademark symbol with MySQL - El Forum - 03-04-2009 [eluser]TWP Marketing[/eluser] FuzzyOne, I pass arrays (and single vars) by reference in almost all cases, to reduce the memory space needed and reduce the execution time. For example, the text in question here is stored as a 'text' data type in MySQL, which can be up to 64KB, I'd rather not have that memory space duplicated from one function call to another. I declare most arrays in the controller and that one memory allocation is used by one or more other functions in the model. While it is rare to use more than a fraction of the 64KB, it is a possibility, so pass-by-reference makes sense. I've not found any part of CI's code that fails due to pass-by-reference (yet...). As far as your second question, without encoding to the db, it works. But I didn't want to risk allowing unprotected HTML being stored in the db. I'll be adding some XSS_cleaning in the future too. Thanks Escaping the trademark symbol with MySQL - El Forum - 03-05-2009 [eluser]TheFuzzy0ne[/eluser] What I meant is that call time pass by reference has been deprecated now. If I run this script: Code: <?php I get this error: Code: PHP Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it I know that this has nothing to do with your problem, I just thought I'd point this out in case you were unaware of it. Escaping the trademark symbol with MySQL - El Forum - 03-05-2009 [eluser]TWP Marketing[/eluser] Fuzzyone, I was not aware of the deprecation. That change seems to make no sense. I'll have to do some research because I want the benefit of using only one instance of a var. PITS! but thanks for the info. UPDATE: I did some research, here: http://devzone.zend.com/article/1714-Whats-New-in-PHP-5 which states: Quote:"This behavior is not very intuitive, as many developers would expect the Java-like behavior. In Java variables actually hold a handle (or pointers) to the object, and therefore, when it is copied only the handle and not the entire object is duplicated. TWP: Note the 'Note:' at the end. This is precisely the need I have. That being said, I am using PHP5 and don't face the problem of having to force my code to run under PHP4, EXCEPT when I deal with CI related programming... It's the exceptions to the rule that bite you every time. Thanks again for making me aware of this whole situation. |