January 14, 2014 at 11:08 am #2847
I am the lead developer of the mobile theme, Graphene Mobile Neo. We have decided to bundle the free version of your mobile theme switching plugin with the theme due to its robustness and stability. Some of the users of our theme have also purchase the pro version of AMTS for W3TC compatibility.
Now to the question, some of our users have reported an issue where some HTML codes is appearing in contact form message area when the page is viewed on mobile devices (screenshot: http://imgur.com/MVhROoe ). After further investigation, we have determined the cause to be the “clickable phone number” feature in AMTS.
I noticed that you’re using PHP’s DOMDocument class to search for the mobile_tel class. However, when using $doc->saveXML(), sometimes additional document declaration ( <?xml … ) is added into the document, causing the layout to break and codes appearing where they shouldn’t.
A temporary fix that we’ve provided to our users is to disable this feature by commenting line 76 of any-mobile-theme-switcher-pro.php file:
// add_filter( ‘the_content’, ‘amtsp_make_phone_clickable’, 20);
This effectively removes the feature and resolves the issue.
Obviously the above is a temporary fix, and I am keen to work together with you in finding a permanent solution. As a start, might I suggest the following solutions:
1. Use preg_replace instead of DOMDocument, or
2. Remove the nodes containing document declaration in the DOMDocument object prior to calling $doc->saveXML().
Thanks!January 16, 2014 at 5:06 am #2850
Thanks so much for reporting this. I did got these issues reported as well. But i never knew what was the cause. Your explanation helped me much. Ya, i think we need to move to preg_replace.
I will change this things and soon send another update.
Thanks a lot 🙂
The topic ‘Clickable phone number feature sometimes breaks the layout’ is closed to new replies.