Jump to content

Warning: htmlentities() expects parameter 2 to be long


Recommended Posts

upgraded to the latest version of the cc4 (from cc 4.3.8 to 4.3.9)

get this error message on the title tag of the page.

<title>Warning: htmlentities() expects parameter 2 to be long, string given in /home/public_html/mystore.com/admin/sources/products/index.inc.php on line 949 - Shoe Store</title>

how to fix it?

Link to comment
Share on other sites

upgraded to the latest version of the cc4 (from cc 4.3.8 to 4.3.9)

get this error message on the title tag of the page.

<title>Warning: htmlentities() expects parameter 2 to be long, string given in /home/public_html/mystore.com/admin/sources/products/index.inc.php on line 949 - Shoe Store</title>

how to fix it?

Yes here you go.

http://bugs.cubecart.com/view.php?id=2063

that should fix it :)

Regards,

Andrea

Link to comment
Share on other sites

Upgraded versions a couple of weeks ago - cannot find the code to fix on or near line 957...

thnx

This is for version 4.3.9 > *if you are getting the error then you need to search for this code*

htmlentities($results[0]['prod_metatitle'],"ENT_QUOTES","UTF-8")

and change to this...

htmlentities($results[0]['prod_metatitle'],ENT_QUOTES,'UTF-8')

Regards,

Andrea :)

Link to comment
Share on other sites

  • 2 weeks later...

Upgraded versions a couple of weeks ago - cannot find the code to fix on or near line 957...

thnx

This is for version 4.3.9 > *if you are getting the error then you need to search for this code*

htmlentities($results[0]['prod_metatitle'],"ENT_QUOTES","UTF-8")

and change to this...

htmlentities($results[0]['prod_metatitle'],ENT_QUOTES,'UTF-8')

Regards,

Andrea :yeahhh:

I've got the same error but I don't have that line in the code anywhere that I can find nor can notepad, word pad or excel find that coding to replace it so what now?

Link to comment
Share on other sites

I've got the same error but I don't have that line in the code anywhere that I can find nor can notepad, word pad or excel find that coding to replace it so what now?
Excel? never heard of someone trying to edit PHP files in Excel before... however neither Excel, Notepad or wordpad are designed to edit PHP files, saving them using those applications may cause problems with additional characters being saved/add. Use an editor designed for PHP files, like Crimson Editor to name one. Google for PHP editors.

Are you sure you're editing the correct file?

Link to comment
Share on other sites

Guest VFR Guy

Well, I just started selling CC, and this is my first project - Pretty scary to find such a horrible security issue on my first job!

I have looked at the code in index.inc.php, and removed the quotes around the ENT_QUOTES - but this hasn't fixed the issue... In fact, I can rename the index.inc.php file comepltely, and I still get the same error. I'm don't know much about Ioncube, but I suspect the original code is cached somewhere, and is still being used.

Link to comment
Share on other sites

Well, I just started selling CC, and this is my first project - Pretty scary to find such a horrible security issue on my first job!

I have looked at the code in index.inc.php, and removed the quotes around the ENT_QUOTES - but this hasn't fixed the issue... In fact, I can rename the index.inc.php file comepltely, and I still get the same error. I'm don't know much about Ioncube, but I suspect the original code is cached somewhere, and is still being used.

Did you clear the store cache afterwards? 'Rebuild & Recount' menu option.
Link to comment
Share on other sites

Guest VFR Guy

Hi Robsta,

Yep... I've tried that... Rebuild & Recount - Clear Cache

I'm a sys admin, and I've never come across anything like this... Does cubecart add symlinks to directories? I actually renamed the /admin directory completely, as a sanity test, and it still gives the same error for line 949 of /admin/sources/products/index.inc.php even though the file doesn't even exist there any more!

Cubecart havn't been much help so far either, just citing the bugfix again. There must be some sort of caching going on.

Google is riddled with search results from other spoiled sites...

Steve

Link to comment
Share on other sites

Guest VFR Guy

Problem solved. It's nothing to do with caching...

I had a great - if cryptic response from support:

If you already stored product with this error message you have to edit and remove it from the meta record area.

This really didn't make much sense to me, but it pointed me at the database, where I found the error message had actually embedded into one of the database fields...

Any products that are added while this code error exists will inherit the error message into the prod_metatitle field of the CubeCart_Inventory table.

The only way to eliminate the problem is to re-edit each product and clear the error message from the Specific Product Meta Data >> Browser Title field. Or just go into MySQL and clear out the crap from all of the records affected... you can do this by:

UPDATE prefix_CubeCart_Inventory SET prod_metatitle = '' WHERE prod_metatitle LIKE '%htmlentities%'

Where prefix_ = your chosen prefix, and you don't really want to use the word htmlentities in any of your product titles!

Steve

Link to comment
Share on other sites

  • 1 year later...
Guest gennad

I was affected by this last year and thought I had manually fixed all the items.

Upgraded to 5.0.1 and noticed it is still on at least one item. The option to edit the title is now gone though from the products. Is that sql snippet still correct for running on the v5 database to fix them?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...