PDA

View Full Version : HTML code not validating with EPC


north
10-26-2009, 11:34 PM
Greetings all,

I have a search.php page in my theme for displaying search results. Something weird is happening with EPC that is causing the code not to validate on this page. The code validates just fine on all other pages using the same header and footer.

The validation error is (there are several others like this):
cannot generate system identifier for general entity "mo" …idth="33%"><a href="index.php?s=ddd&mo=9&amp;yr=2009" class="navTableText"><i...

The code on the other pages that validates looks like:


<td align="left" width="33%"><a href="index.php?mo=9&amp;yr=2009 (http://www.easyphpcalendar.com/forums/view-source:http://www.highintegritydesign.com/test/uos/index.php?mo=9&yr=2009)" class="navTableText">...
So EPC is inserting the '?s=ddd' code into its navTable generated code. the '?s=ddd' is what I searched for in my search form ('ddd'). Whatever I type into my search form gets injected into the code as above. I'm guessing this is some kind of javascript text substitution gone awry. Can anyone help please?

Thanks

NorthK

ve9gra
10-27-2009, 08:05 AM
The calendar keeps the URI string as defined by the browser. In your case, s= is the search field, and "ddd" is the value you searched for... so "s=ddd" is the WP search string, and has nothing to do with EPC.

One thing I can say, and this will need to involve Brian, this is the URL checking function that verifies if there are any variables in the GET, and appends the ? and & to the URL... so it would seem that the & for when there are things in the URI already hasn't been "htmlspecialchars'ed".

Brian
10-27-2009, 10:21 AM
I think WP is doing that to the ampersand. I've never seen it do that before.

north
10-27-2009, 12:30 PM
Hi guys,

Thanks a lot for your responses. I understand that EPC doesn't create the "s=ddd" string. As you mention, this is a GET or POST variable that WordPress is passing to PHP so it can accomplish the search.

However, what I think is happening is that EPC is grabbing all of the GET/POST variables sent to the page, parsing them, and placing them into the calendar navigation code. IMO, what it should do is grab and parse only the variables that it uses, but not any other variables that might be there.

I think that anyone creating a search results page for WordPress and using EPC will have this same problem. Or, for that matter if they are using a GET/POST with their page w/o using WordPress, I think that might show the problem too. If I'm wrong about what is happening (could be), please let me know.

Do you have any suggestions for a fix? It's really messing up the page :) The only thing I could think of is to use the AJAX version of the calendar, which perhaps may not stick in the GET/POST variables? But I haven't tried using the AJAX version...

Please advise, and thanks.

-NorthK

Brian
10-27-2009, 12:31 PM
It is only set to parse what's in the URL when the page is loaded. It doesn't grab variables. It reads the link.

north
10-27-2009, 12:44 PM
Hi Brian, I get that EPC is parsing what's in the URL :) What I'm suggesting is that EPC should parse what's in the URL and grab/use only the parameters that it needs, rather than all of the parameters that might be in the URL. I realize this is probably a code change for EPC that is not insignificant-- but perhaps there is a workaround?

If there is any way to accomplish this, or you have alternative suggestion for how I make this work, I'd sure appreciate your help.

Thanks a lot,

NorthK

Brian
10-27-2009, 12:46 PM
This hasn't been an issue before and was a needed feature to make sure other GET variables on the page don't break when they are missing.

We may can add in a feature to turn this off with a specific variable set in the page. If this would help, please add this to the feature requests forum. :)

north
10-27-2009, 12:58 PM
Hi Brian. Thanks for considering this for a future release.

Is there any workaround I can do for right now? Does the AJAX method of displaying the calendar avoid using GET/POST variables? Or, can I accomplish calendar navigation another way?

Regardless, I'm buying multiple licenses 'cause I think this is a good product which I can use for many of my clients. However, it's really messing up the validation. The browser seems to render it anyway, but I can't rely on every browser being able to do that...plus there could be other situations besides WordPress where GET/POST variables are needed.

Thanks,

NorthK

Brian
10-27-2009, 12:59 PM
You can write your own navigation. See www.epctutorials.com for a tutorial.

north
10-27-2009, 01:00 PM
Hi Brian, can you please comment on the AJAX approach?

Thanks

NorthK

Brian
10-27-2009, 01:02 PM
You would need to test the AJAX to see if it would work for you in this setup. It's a pre-release Beta, so it's not officially supported, but does work in many instances.

ve9gra
10-27-2009, 01:51 PM
Hey Brian, I think the problem is in the logic that tests if there are already arguments in the URI. Normally, the script will add the ? and then the epc variables. But in the case where there are already arguments, it'll add ?<the-existing-arguments>&<epc-variables>...

I think that the & in that case was not properly escaped, as in &amp;