Wordpress htmlspecialchars error

Howard Bash
Howard Bash used Ask the Experts™
on
When running wordpress XML Sitemap Generator, I sometimes get the following error "htmlspecialchars expects parameter 1 to be string php"

Please advise.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jason C. LevineDon't talk to me.

Commented:
Taken literally, it means that the plugin is trying to parse a variable using the htmlspecialchars() function but instead of a variable with a single value, it is encountering an array of values and choking on it.

Do you have any funky formatting anywhere where multiple content sources are aggregated into a single page (photo gallery, tabbed pages, etc)?  What other plugins are present?
Howard BashSenior Software Engineer

Author

Commented:
No formatting done on my part.  The following are the active plugins:
Alexa Rank Widget
Embedded Video
Google XML Sitemaps
WordPress Database Backup
WP-ShortStat
WP-Stats
WP-UserOnline
WPTouch
Jason C. LevineDon't talk to me.

Commented:
Try disabling all plugins except XML site maps and see if the error happens.  Alternately, try replacing the XML plugin with a different XML plugin with all other plugins active and see if you still get the error
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Howard BashSenior Software Engineer

Author

Commented:
The error is shown in the XML Sitemaps setup page.  So removing it wouldn't make sense here.  I will disable the other plugins and get back with the results.
Jason C. LevineDon't talk to me.

Commented:
>>  So removing it wouldn't make sense here

I know that, which is why I said:

Try disabling all plugins except XML site maps
Howard BashSenior Software Engineer

Author

Commented:
In the second sentence you write:

" Alternately, try replacing the XML plugin with a different XML plugin with all other plugins active and see if you still get the error "

Which prompted me to remark that as the error is within the plugin,  removing the XML plugin will remove the error...  

I'll let you know if the disabled plugins have an affect.
Jason C. LevineDon't talk to me.

Commented:
But the error may be in how WordPress is outputting an object to the XML file in which case you would get the error in every plugin that writes to XML, right?  We are attempting to pinpoint the problem:  this plugin, another plugin, or the way your content is being converted.  It's a quick and dirty test to check that you can output to XML at all.
Howard BashSenior Software Engineer

Author

Commented:
Can you suggest an alternate xml plugin?
Howard BashSenior Software Engineer

Author

Commented:
So far the problem persists and the suggested google-xml-sitemaps plugin is showing the error upon attempting to run it (not always).
Jason C. LevineDon't talk to me.

Commented:
What does "not always" mean?
Howard BashSenior Software Engineer

Author

Commented:
The google xml plugin code runs the rebuild function in a couple of ways.  It runs after you add a post.  It runs when you explicited ask it to via clicking the rebuild link on it's setup page.  And then there is another way that kicks it off which I am not sure of.  I do not see the error for the two methods only for this other method.  I am not sure if it is some periodic run of the rebuild or a run of the rebuild due to a comment being added.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial