Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Killing-Hours
Newbie
Newbie



Joined: Mar 24, 2011
Posts: 10

PostPosted: Wed Jul 27, 2011 10:37 am Reply with quote

Montego-

Discovered a new issue with shortlinks and the way it handles javascript today.

Background:

SL 1.3.0
Adbrite

How to replicate:

Adbrite uses "document.write" to insert the ad into the webpage. When shortlinks is activated... it causes an issue of some sort that I haven't had time to figure out yet.

Here is the screenshot of firebug:

Image

I can't provide the adbrite code because it will violate the T.O.S.

Edit****

Here is the code I believe is being messed up... I've altered some of it so that I'm not breaking the T.O.S. (I hope).

Code:
<script type="text/javascript">document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=XXXXXXX&zs=XXXXXXXXX&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));</script>


The way I've inserted this into the webpage is by breaking out of php... inserting the javascript then jumping back into php.

Code:
<?php

Php stuff all in here

?>

Adbrite code here

<?php

More php stuff here

?>
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Jul 29, 2011 8:08 am Reply with quote

Killing-Hours,

I don't see any string patterns that would be affected by ShortLinks. This is JavaScript code, so it is important as to where/how that is incorporated into your site.

What you have shown so far is so minimal, I can't really be helpful here. TOS or not, if you want help, I'm going to have to see more. If you would rather, send it to me at montego --AT-- montegoscripts you-know-what com and I'll take a look. Of course, everything will be deleted once we figure this out, so not really a TOS violation is it? We're debugging your site.

I'll need to see the PHP script referenced and any externally pulled in .js file.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 1:36 pm Reply with quote

I think that I may know what is causing this and I will try and post a code change here to have you test out for me. I have documented the issue as such:

http://mantis.montegoservices.com/view.php?id=552

Thank you for bringing this to my attention (and for the additional email sends) and sorry for the bug!

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 3:27 pm Reply with quote

Killing-Hours, I have uploaded to the above referenced bug tracking system issue a new shortlinks.php file to replace the one in includes/tegonuke/shortlinks directory (please take a backup first).

What I changed was this code here from this (down towards the very bottom):

Code:

return $matches[1] . '="' . $link . '"';


Changed to this:

Code:

return $matches[1] . $matches[2] . $link . $matches[4];


I was trying to "clean" too much. This is going to change the "&" characters in your posted code to "&amp;", so I am curious to see if that causes an issue with the operations of the ad network.

If you like, I can be the one to click on an ad for you, once you have replaced the file.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Killing-Hours
Newbie
Newbie



Joined: Mar 24, 2011
Posts: 10

PostPosted: Tue Aug 02, 2011 5:42 pm Reply with quote

Give me about an hour or so. I'll be home then and it'll be after hours so I won't have clients on and I can shut the site down to test.

Also, don't forget to get me a list and a general style you want to push towards with your graphics and email me so I can toss a few noodles at the fridge and see what sticks. Wink Once we have an agreed style for your stuff... I can make em' up for ya. (Just a pat on the back is good enough for me granted it's not completely overwhelming)
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 6:05 pm Reply with quote

Killing-Hours wrote:
Give me about an hour or so. I'll be home then and it'll be after hours so I won't have clients on and I can shut the site down to test.


Ok, just send me an email when you want me to take a look.

Quote:
Also, don't forget to get me a list and a general style you want to push towards with your graphics and email me so I can toss a few noodles at the fridge and see what sticks. Wink Once we have an agreed style for your stuff... I can make em' up for ya. (Just a pat on the back is good enough for me granted it's not completely overwhelming)


No worries. This is many moons away as I have far more pressing projects to attend to. Just been something on my mind for a long time. Eventually I'll get around to it, so thank you for the offer and download icon.
 
View user's profile Send private message Visit poster's website
spasticdonkey
Newbie
Newbie



Joined: Sep 05, 2007
Posts: 78

PostPosted: Tue Aug 02, 2011 7:11 pm Reply with quote

montego wrote:
I was trying to "clean" too much. This is going to change the "&" characters in your posted code to "&amp;", so I am curious to see if that causes an issue with the operations of the ad network. .


I know we ran into some mystery "&amp;" appearing in our disqus code when shortlinks was disabled (previous version). This broke the disqus_url if it contained "&". Links generated by disqus started looking like:

modules.php?name=News&amp;file=article&amp;sid=161

which did cause issues. I can't say reliably shortlinks was the culprit, as I don't know if it does some link cleansing even when disabled..
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 7:18 pm Reply with quote

Nope, disabled = no SL code executed. However, it sure sounds like you had SL ON as it does link cleansing just like you mentioned.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Killing-Hours
Newbie
Newbie



Joined: Mar 24, 2011
Posts: 10

PostPosted: Tue Aug 02, 2011 7:51 pm Reply with quote

So far everything looks great with that change. Ads show fine... Site shows fine... Links tap fine. Thanks for the fix Montego!

Been aching to shorten the links on the work site.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 7:56 pm Reply with quote

Yeah, see my latest email and let me know what you think. Just need to make sure you are getting the proper credit for these ads, right?

For the others who come to this thread, what will happen is the code Killing-Hours posted here:

Code:
document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=XXXXXXX&zs=XXXXXXXXX&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');


Will end up looking like this:

Code:
document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=XXXXXXX&amp;zs=XXXXXXXXX&amp;ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');


See the "&amp;" at the front end of the concatenation then followed by the others with just "&". Haven't a clue how this will work. Should be investigated.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 02, 2011 10:11 pm Reply with quote

Killing-hours has validated that the fix is working for him. Thanks for letting me know. Now it will also be interesting to see if the thread over at kguske's site regarding Discus can also be confirmed by Spasticdonkey. If so, I have enough to cut a 1.3.1 patch.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch
linear-bunch