Page 1 of 1

Entity 'reg' not defined - s2Member Site Secured Badge Error

PostPosted: January 27th, 2012, 12:26 am
by cclambie
Hi s2Member Users,

I just discovered an validation problem with s2Member badge:

I am using this DTD - http://www.openmobilealliance.org/tech/ ... bile12.dtd - for my site, and it does not have the HTML Entity 'reg' defined.

ie. I am getting the error "error on line 150 at column 432: Entity 'reg' not defined"

And on line 150 is :
Code: Select all
<a href="http://www.s2member.com/" onclick="window.open('http://www.s2member.com/s-badges/s-details.php?v=1&amp;site_url=http%3A%2F%2Fm.truesecrets.com.au%2Fstrange-tours-melbourne', '_popup', 'width=752,height=702,left='+((screen.width/2)-(752/2))+',screenX='+((screen.width/2)-(752/2))+',top='+((screen.height/2)-(702/2))+',screenY='+((screen.height/2)-(702/2))+',location=0,menubar=0,toolbar=0,scrollbars=0,resizable=1'); return false;" title="s2Member&reg;"><img src="//www.s2member.com/s-badges/s-badge.php?v=1&amp;site_url=http%3A%2F%2Fm.truesecrets.com.au%2Fstrange-tours-melbourne" style="border:0;" alt="s2Member&reg;" title="s2Member&reg; ( Security for WordPress&reg; )" /></a>


So I have downloaded the .dtd and self hosted it, pointing the DOCTYPE to my dtd, with
<!ENTITY reg "&#174;">
<!ENTITY raquo "&#187;">
<!ENTITY reg "&reg;">
<!ENTITY raquo "&raquo;">

But that hasn't worked :(

Any ideas on how to fix this?
If I knew where in s2Member to find the output code for the button I would try replacing "&reg;" with "&#174:" I have read this works on more DTDs than the other.

Re: Entity 'reg' not defined - s2Member Site Secured Badge E

PostPosted: January 27th, 2012, 9:48 pm
by cclambie
According to an Expert on EE this is not allowed to be used here in HTML....
http://www.experts-exchange.com/Web_Dev ... #a37510590

Thoughts?

Re: Entity 'reg' not defined - s2Member Site Secured Badge E

PostPosted: January 30th, 2012, 4:03 pm
by Jason Caldwell
Thanks for reporting this important issue.

Please check this file in your s2Member distribution.
/s2member/includes/templates/badges/s-badge.php

Re: Entity 'reg' not defined - s2Member Site Secured Badge E

PostPosted: January 31st, 2012, 2:18 am
by cclambie
Thanks Jason, that fixed it.

Updated file code to comply with HTML entity limitations of that DTD for Mobile.
Code: Select all
<?php
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
   exit("Do not access this file directly.");
?>

<div class="ws-plugin--s2member-s-badge">
<a href="http://www.s2member.com/" onclick="window.open('http://www.s2member.com/s-badges/s-details.php?v=%%v%%&amp;site_url=%%site_url%%%%no_cache%%%%display_on_failure%%', '_popup', 'width=752,height=702,left='+((screen.width/2)-(752/2))+',screenX='+((screen.width/2)-(752/2))+',top='+((screen.height/2)-(702/2))+',screenY='+((screen.height/2)-(702/2))+',location=0,menubar=0,toolbar=0,scrollbars=0,resizable=1'); return false;" title="s2Member&#174;"><img src="//www.s2member.com/s-badges/s-badge.php?v=%%v%%&amp;site_url=%%site_url%%%%no_cache%%%%display_on_failure%%" style="border:0;" alt="s2Member&#174;" title="<?php echo esc_attr (_x ("s2Member&#174; ( Security for WordPress&#174; )", "s2member-front", "s2member")); ?>" /></a>
</div>