Guest Posted November 8, 2005 Share Posted November 8, 2005 Hi Before I start I have searched the forum and I have made the changes Sir William Kindly posted as below. However If I go to admin and try to change the homepage in the editor via source feature. The ' goes missing and I get # 39: rubbish in its place please can anyone including the problem solver Sir William tell me what I would need to change so that the source feature keeps the ' Thanks Ok, here is the quick, dirty fix. I'm going to talk to brooky before I write a full fix. I'm not sure if that's how he wants it handled. The problem is that the htmlspecialchars() function is messing up your single and double quotes in your product names, etc. There is an optional command to include in that function call that will leave single and double quotes alone but will still parse out the HTML markup. The syntax is htmlspecialchars($varname, ENT_NOQUOTES) The ENT_NOQUOTES is not in there currently. To fix this issue, you need to add it into each instance of htmlspecialchars in each of these files. I believe there are 26 total instances of the function call. Here's the file list: /admin/products/index.php /admin/settings/currency.php /includes/content/viewProd.inc.php /includes/content/cart.inc.php /includes/content/index.inc.php /includes/content/viewCat.inc.php /includes/content/viewDoc.inc.php /includes/boxes/siteDocs.inc.php /includes/boxes/categories.inc.php /includes/boxes/popularProducts.inc.php /includes/boxes/randomProd.inc.php /includes/boxes/saleItems.inc.php /includes/boxes/shoppingCart.inc.php /includes/functions.inc.php /index.php Here's an example from the index.php file: CODE $body->assign("META_TITLE",$config['siteTitle'].c().htmlspecialchars($meta['siteTitle'])); Here's the adjusted version: CODE $body->assign("META_TITLE",$config['siteTitle'].c().htmlspecialchars($meta['siteTitle'], ENT_NOQUOTES)); See? I told you I'd have a fix for ya. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2005 Share Posted November 8, 2005 Anyone ???? I thought there might be at least one person would know what to do..... ??? Quote Link to comment Share on other sites More sharing options...
Guest EverythingWeb Posted November 8, 2005 Share Posted November 8, 2005 Hello, I have a fix for this somewhere. I will try and dig it out for you today. Cheers. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2005 Share Posted November 8, 2005 Hello, I have a fix for this somewhere. I will try and dig it out for you today. Cheers. See I knew there would be someone Thanks EverythingWeb Quote Link to comment Share on other sites More sharing options...
Guest EverythingWeb Posted November 8, 2005 Share Posted November 8, 2005 searchty, What version of CubeCart are you running, as the fix I have, was applied in 3.0.5 ? Cheers. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2005 Share Posted November 8, 2005 Hi I am using 3.05 thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 searchty, What version of CubeCart are you running, as the fix I have, was applied in 3.0.5 ? Cheers. Hi EverythingWeb Did you mean you had used the fix in 3.05 or that the fix was already in 3.05 by brooky :huh: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 anyone ? HELP? :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 I have some ideas, but haven't had time to test them yet. Once I can, I'll confirm a solution....unless of course Brooky has already addressed it in 3.0.6 which is due out VERY soon. :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 Thanks Sir William In the meantime if anyone works it out please post solution thanks :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 11, 2005 Share Posted November 11, 2005 hello Do we know if this problem was solved in cc 3.06? IF SO HOW? THANKS Quote Link to comment Share on other sites More sharing options...
Guest Posted November 11, 2005 Share Posted November 11, 2005 Hello Did we sort out the ' problem ? I was told to wait for 3.06 is it fixed and do I need to upgrade to 3.06 to fix it ? thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Yes. So far as I can tell, it's fixed properly. */* Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 (edited) Yes. So far as I can tell, it's fixed properly. No...... Its not sorted still getting # 39 ;; rubbish instead of ' when using the source function in admin............? I have updated to 3.06 ok the code below <script language=JavaScript> */ var img_width = "468"; var img_height = "60"; var img_title = "Click Here"; var ad=new Array() //insert here your images src ad[0]='http://www.site.com/image1'; ad[1]='http://www.site.com/image2'; ad[2]='http://www.site.com/image3'; ad[3]='http://www.site.com/image4'; ad[4]='http://www.site.com/image5'; var links=new Array() //insert here your links links[0]='http://www.links1'; links[1]='http://www.links2'; links[2]='http://www.links3'; links[3]='http://www.links4'; links[4]='http://www.links5'; var xy=Math.floor(Math.random()*ad.length); document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>'); </SCRIPT> open admin got to homepage as if to edit it the click on source drop the code in then click update homepage then click source again and you will see what I mean I hope ...... Thanks Edited November 12, 2005 by searchty Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 NO ANSWER WAS THE BOLD REPLY ??? Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted November 12, 2005 Share Posted November 12, 2005 Patience my friend, patience :blink: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Patience my friend, patience LOL Sorry :( Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Ok, since you wanna be pushy about it. I found your solution. In /includes/functions.inc.php, you need to add this function before (or after) the validHTML function (2nd function in the file) as follows: ////////////////////////////////// // leave single quotes/apostrophes in description so JavaScript can be used // NOT w3c compliant, but some people don't care. //////// function treatApostrophes($var){ $var = eregi_replace("&#39;","'",$var); $var = eregi_replace("'","'",$var); return $var; } Now, in /includes/functions/content/viewProd.inc.php around line 73, you'll find this: $view_prod->assign("TXT_DESCRIPTION",$prodArray[0]['description']); Change it to this: $view_prod->assign("TXT_DESCRIPTION",treatApostrophes($prodArray[0]['description'])); Have fun! :blink: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Ok, since you wanna be pushy about it. I found your solution. In /includes/functions.inc.php, you need to add this function before (or after) the validHTML function (2nd function in the file) as follows: ////////////////////////////////// // leave single quotes/apostrophes in description so JavaScript can be used // NOT w3c compliant, but some people don't care. //////// function treatApostrophes($var){ $var = eregi_replace("&#39;","'",$var); $var = eregi_replace("'","'",$var); return $var; } Now, in /includes/functions/content/viewProd.inc.php around line 73, you'll find this: $view_prod->assign("TXT_DESCRIPTION",$prodArray[0]['description']); Change it to this: $view_prod->assign("TXT_DESCRIPTION",treatApostrophes($prodArray[0]['description'])); Have fun! Dammm your good Sir William WORKED A TREAT THANKS FOR YOUR TIME Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Hold the horses Sir William the fix comes up with a sslSwitch.inc.php error. ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.