ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> Suggestions and Feedback

Bug with IE7 and free html encoder (CSS, scripts, div tag)

Author Message
jsherk



Joined: 14 Jul 2007
Posts: 5

PostPosted: Wed May 06, 2009 4:12 pm    Post subject: Bug with IE7 and free html encoder (CSS, scripts, div tag) Reply with quote

I have been using your free obfuscating html encoder, and have found a bug with regards to how it handles a specific issue in IE7 with regards to using css for div or span tags and external script files.

How to recreate:

(1) Load the following php and js files on your server.
(2) Leave the // in front of require("html_encoder_1.9.php");
(3) Run test.php on both Firefox and IE7 and you will see that the text displays properly in both.
(4) Now uncomment the require("html_encoder_1.9.php"); and reload this file on your server.
(5) Run test.php on both Firefox and IE7 again, and you will note that Firefox still displays the tesxt in the correct position, but IE7 now displays the text form the js file in the top left corner, instead of displaying it at the co-ordinates of 200x200.

FILE: test.php
[code]
<?php
//require("html_encoder_1.9.php");
?>
<html>
<head>
<style type="text/css" media="screen">
#Text1 {position: absolute; left: 100px; top: 100px;}
#Text2 {position: absolute; left: 200px; top: 200px;}
</style>
</head>
<body>
<div id="Text1">
This is TEXT1.
</div>
<div id="Text2">
<script src="test.js" language="JavaScript" type="text/javascript"></script>
</div>
</body>
</html>
[/code]

FILE: test.js
[code]
document.write('And this is TEXT2!');
[/code]
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2756

PostPosted: Wed May 06, 2009 9:10 pm    Post subject: Reply with quote

Thanks for the post, however this may not be a bug in the HTML Encoder. The HTML Encoder captures all output from PHP and turns it into Javascript that when executed reproduces the original PHP content and writes it into the document. This should produce content that is processed by the browser in the same way that it would have been if it were part of the downloaded page, however the change in behaviour could be a side effect of using Javascript to wrap the HTML content and regenerate it on the fly, and IE 7 not being able to handle this transparently (in essence an IE 7 bug perhaps). You could try restructuring the page or using an external style sheet to keep IE 7 happy.
_________________
Community Admin
Back to top
View user's profile Send private message
jsherk



Joined: 14 Jul 2007
Posts: 5

PostPosted: Fri May 22, 2009 10:27 pm    Post subject: Reply with quote

But since it works fine when the encoder is not used (encoder line is commented out), does that not point back to the encoder as possibly having the bug?
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2756

PostPosted: Sat May 23, 2009 12:06 am    Post subject: Reply with quote

While obviously related to what the HTML Encoder does, this doesn't mean that the bug, or shortcoming, is not within IE. The HTML Encoder turns the original static page content into Javascript code, and it's the Javascript that is sent to the browser rather than the original page content. The real page content is then created dynamically and on the fly within the browser when the Javascript runs, and the browser renders the true page content when is reparses the result of having run the Javascript. This process is entirely different to how the data for the original page was obtained and rendered, and it's likely that while other browsers are able to render the dynamically created page content in the same way as if it were the original page content, IE simply doesn't. It would be related to the page content itself and the browser implementation.

Creating content on the fly within the browser and dynamically modifying page content and meta data is a challenge for browsers to handle. These days most browsers are going to do this without problem, and many modern web sites rely on this to a limited extent, but finding some page content that doesn't get rendered correctly via that technique on all browsers is quite possible.

I didn't have IE7 to hand, but IE8 failed miserably on the Acid3 test, and it's not uncommon for browsers to have lurking rendering problems that get exposed under extreme cases.
_________________
Community Admin
Back to top
View user's profile Send private message
jsherk



Joined: 14 Jul 2007
Posts: 5

PostPosted: Sat May 30, 2009 9:14 pm    Post subject: Reply with quote

okay, i think i got it!

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> Suggestions and Feedback All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum