PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Mon Jan 14, 2008 8:22 am Reply with quote Back to top

I don;t know if this a bug or just me....

but I have an advertiser that has a url that looks like this....
/content.asp?nav=96040&cpid=4911&isPreview=True

So I put it in the Advertising MOD for his banner to link to and I get this...
/content.asp?nav=96040&cpid=4911&isPreview=True

I have also tried using the & when I input the url....

I know what it is doing and I know why it is doing it.

My question is how do we make the link work once it comes out?

Is this a "Bug"?

Dawg
View user's profile Send private message
technocrat
Life Cycles Becoming CPU Cycles


Joined: Jul 07, 2005
Posts: 511

PostPosted: Mon Jan 14, 2008 11:56 am Reply with quote Back to top

This should only be used in links on a page. It makes the link HTML compliant is all.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

PostPosted: Mon Jan 14, 2008 11:58 am Reply with quote Back to top

It's definitely a bug if you're putting it as & and it's coming out as &, causing the link to fail.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Mon Jan 14, 2008 6:05 pm Reply with quote Back to top

Well I found one then.....now the 500 dollar question....what do I need to do to fix it?

I can go look through the code.....what am I looking for?

Dawg
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Tue Jan 15, 2008 6:30 am Reply with quote Back to top

Sounds to me like check_html() is being called to validate the URL (in order to strip out any HTML I bet) and that function in RN will also normalize the entities. At this point, I would suggest changing the data in the DB using phpMyAdmin. Let us know if it is being changed back on coming OUT of the db.

We'll have to look into this further...
View user's profile Send private message Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Tue Jan 15, 2008 6:46 am Reply with quote Back to top

montego,
I will do that....and I have a couple other sites that I will run the same thing through and see what happens. These are fairly fresh installs. If you would like to take a closer look just PM me and I will open it up for you.

Dave
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Tue Jan 15, 2008 8:55 am Reply with quote Back to top

I checked the Db....It is correct there....
/content.asp?nav=96040&cpid=4911&isPreview=True

So it is getting mangled coming out of the database.

Any idea what I can do to fix it?

Dawg
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Wed Jan 16, 2008 1:22 pm Reply with quote Back to top

I have looked at the ad_click function and saw nothing that looked to be the issue....

Have any ideas where to look? Anyway to fool it into letting the & through?
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Wed Jan 16, 2008 6:07 pm Reply with quote Back to top

Dawg, I do see some differences between 2.10.01 and the upcoming 2.20.00 release that is in SVN. Try this for kicks (as I do not have time right now to think this through and/or test):

=== OPEN FILE ===

/index.php

=== FIND CODE ===

Code:

require_once('mainfile.php');
global $prefix, $db, $admin_file;


=== RIGHT AFTER ADD THIS ===

Code:

if (isset($op) AND ($op == "ad_click") AND isset($bid)) {
   $bid = intval($bid);
   $sql = "SELECT clickurl FROM ".$prefix."_banner WHERE bid='$bid'";
   $result = $db->sql_query($sql);
   list($clickurl) = $db->sql_fetchrow($result);
   $db->sql_query("UPDATE ".$prefix."_banner SET clicks=clicks+1 WHERE bid='$bid'");
   update_points(21);
   Header("Location: ".htmlentities($clickurl));
   die();
}


=== DONE ===

See if that works.
View user's profile Send private message Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 884

PostPosted: Wed Jan 16, 2008 6:41 pm Reply with quote Back to top

They were more or less the same. What I did was
Code:
    Header("Location: ".$clickurl);
 //  Header("Location: ".htmlentities($clickurl));


kill the htmlentities. AM I opening any holes in doing this?

Dave
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Thu Jan 17, 2008 6:19 am Reply with quote Back to top

Aw, yes, good catch. Hhhhmmm.... that htmlentities is definitely not right.. I need to see about getting that corrected. I'll have to look for a vulnerability. I might want to encode the URL, but not sure yet just how header handles that. I think it should just fine.
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

PostPosted: Thu Jan 17, 2008 6:06 pm Reply with quote Back to top

Removing htmlentities here shouldn't open any holes.
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Fri Feb 08, 2008 7:09 am Reply with quote Back to top

BTW, this is fixed in the upcoming 2.20.00 release.
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum