<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Thanks Paul but I was checking the settings on each server via phpinfo. I also checked the other magic_quotes settings and they are off on all 3 servers. So yes it is strange but I did note from previous discussion that setting </span><span lang=EN-US style='color:#1F497D'>magic_quotes_gpc to on hadn't resolved the issue for them either so I'm wondering if there's something else at play here. I guess use of latex in XOT isn't that common and if the issue only arises on some configurations in perhaps explains why this hasn't cropped up more often.</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='color:#1F497D'><o:p> </o:p></span></a></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Paul Swanson<br><b>Sent:</b> 21 January 2013 19:31<br><b>To:</b> Xerte discussion list<br><b>Subject:</b> [Xerte] Re: latex/stripslashes/magic quotes etc<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>That’s strange! Are you checking the php.ini in the php directory? It’s not always the ini file being used. The best way to determine what ini file is being used is to run phpinfo() and see what is in the Loaded Configuration File setting. Sometimes you will find that it is being loaded from a different location. The output will also tell you what magic_quotes_gpc is set to. I’m not sure what impact magic_quotes_runtime would have, but if that is off on server 3 but on on server 2, it might need to be factored in as well.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><b><span lang=EN-US style='color:#365F91'>Paul Swanson<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Internal Business Systems Analyst<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Internal Business Intelligence<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Harland Financial Solutions<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>(800) 274-7280 Ext. 2462<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'><a href="mailto:Paul.Swanson@harlandfs.com">Paul.Swanson@harlandfs.com</a></span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-bounces@lists.nottingham.ac.uk">xerte-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-bounces@lists.nottingham.ac.uk">mailto:xerte-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Ron Mitchell<br><b>Sent:</b> Monday, January 21, 2013 11:11 AM<br><b>To:</b> 'Xerte discussion list'<br><b>Subject:</b> [Xerte] Re: latex/stripslashes/magic quotes etc<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Ok have compared 3 different linux servers all the same XOT code and results as follows:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>server 1<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>php 5.3.2<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>magic_quotes_gpc = off<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>no problem with stripping slashes in latex code e.g. latex works fine even when editing and publishing etc<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>server 2<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>php 5.3.8<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>magic_quotes_gpc=on<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>has problem with stripping slashes<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>server 3<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>php 5.3.17<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>magic_quotes_gpc=on<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>no problem with stripping slashes in latex code e.g. latex works fine even when editing and publishing etc<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>so it seems like the magic_quotes_gpc setting isn't the culprit? What else could it be? Or am I missing the point?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-bounces@lists.nottingham.ac.uk">xerte-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-bounces@lists.nottingham.ac.uk">mailto:xerte-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Ron Mitchell<br><b>Sent:</b> 21 January 2013 18:27<br><b>To:</b> 'Xerte discussion list'<br><b>Subject:</b> [Xerte] Re: latex/stripslashes/magic quotes etc<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Thanks for the suggestion Paul.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>But in terms of XOT I'm looked through most of the previous discussion about this in different threads and it's not clear why this stripping of slahes happens on some servers and not on others. As I mentioned as a test I turned magic_quotes_gpc on server wide but that didn't prevent the slashes from being stripped. Also in a previous thread the use of ini_set( 'magic_quotes_gpc', true ); in save.php didn't resolve the issue either.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>stripslashes is used in at least a few different places in save.php so I'm not sure it's a good idea to go messing with that before identifying what the difference is between servers where this is an issue and those where it's not. I'm going to compare phpinfo results first to try to spot the difference.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Cheers<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Ron<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-bounces@lists.nottingham.ac.uk">xerte-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-bounces@lists.nottingham.ac.uk">mailto:xerte-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Paul Swanson<br><b>Sent:</b> 21 January 2013 17:48<br><b>To:</b> Xerte discussion list<br><b>Subject:</b> [Xerte] Re: latex/stripslashes/magic quotes etc<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>On my php applications, I use the following function before saving any data to the database:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>// function for escaping and trimming form data<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>function escape_data ($data) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> global $dbc;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> if (ini_get ('magic_quotes_gpc')) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> $data = stripslashes ($data);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> return mysql_real_escape_string (trim ($data), $dbc);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>} // end of escape_data() function<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>It checks to see if magic_quotes_gpc is on, and if so, employs the stripslashes function, since magic_quotes adds slashes. If magic_quotes isn’t on, it skips the stripslashes function. This function ensures that either configuration is handled.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>$dbc in the function is the database connection resource variable.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><b><span lang=EN-US style='color:#365F91'>Paul Swanson<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Internal Business Systems Analyst<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Internal Business Intelligence<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>Harland Financial Solutions<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'>(800) 274-7280 Ext. 2462<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:#595959'><a href="mailto:Paul.Swanson@harlandfs.com">Paul.Swanson@harlandfs.com</a></span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-bounces@lists.nottingham.ac.uk">xerte-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-bounces@lists.nottingham.ac.uk">mailto:xerte-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Ron Mitchell<br><b>Sent:</b> Monday, January 21, 2013 9:04 AM<br><b>To:</b> 'Xerte discussion list'<br><b>Subject:</b> [Xerte] latex/stripslashes/magic quotes etc<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>Hi all<o:p></o:p></p><p class=MsoNormal>this has been discussed previously but in different threads and I decided it would be worth summarising and checking this in a new thread...<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In previous discussions it's clear that depending on php configuration previewing and/or publishing was/is stripping slashes to the point that latex code had all slashes removed and therefore didn't work. There was a suggestion of using ini_set( 'magic_quotes_gpc', true ); in save.php but it's not clear if that resolved the issue.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have an installation (linux) where this is happening so as a test I turned on magic_quotes_gpc server wide but that hasn't resolved the issue. Also I read that magic quotes has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So what's the solution to this? Why is it working ok on the Nottingham install but not for me and others? Or is it?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers<o:p></o:p></p><p class=MsoNormal>Ron<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p></div></body></html>