Topic: Redirecting index.php

When I post new topic or if I send private message etc I am always redirected to the first index.php page
Its the same if I change in admin options. After my settings are made I go to index.php
Anyone how knows the problem with it?

Re: Redirecting index.php

Paste your code so we can take a look at it? wink

Re: Redirecting index.php

Smartys wrote:

Paste your code so we can take a look at it? wink

I should think before I post :=)
I figured out I forgot to remove $destination_url = 'index.php'; in functions.php in update 1.2.16.

Re: Redirecting index.php

Thanks Patrik I was having the exact same problem with 1.2.16
I removed $destination_url = 'index.php'; and cleared the cache folder, now it behave the way I like it to (i.e not redirecting to the index) : )

Here's my current section in function.php

//
// Display $message and redirect user to $destination_url
//
function redirect($destination_url, $message)
{
    global $db, $pun_config, $lang_common, $pun_user;

     // Prefix with o_base_url (unless it's there already) 

     if (strpos($destination_url, $pun_config['o_base_url']) !== 0) 
         $destination_url = $pun_config['o_base_url'].'/'.$destination_url; 
  
     // Do a little spring cleaning 
     $destination_url = preg_replace('/([\r\n])|(%0[ad])|(;[\s]*data[\s]*:)/i', '', $destination_url);

Re: Redirecting index.php

Vanslyde wrote:

Thanks Patrik I was having the exact same problem with 1.2.16
I removed $destination_url = 'index.php'; and cleared the cache folder, now it behave the way I like it to (i.e not redirecting to the index) : )

Here's my current section in function.php

//
// Display $message and redirect user to $destination_url
//
function redirect($destination_url, $message)
{
    global $db, $pun_config, $lang_common, $pun_user;

     // Prefix with o_base_url (unless it's there already) 

     if (strpos($destination_url, $pun_config['o_base_url']) !== 0) 
         $destination_url = $pun_config['o_base_url'].'/'.$destination_url; 
  
     // Do a little spring cleaning 
     $destination_url = preg_replace('/([\r\n])|(%0[ad])|(;[\s]*data[\s]*:)/i', '', $destination_url);

Great that helped you too! Though I still have some problems with 1.2.16 when I use some plugins (AP_Links_with_category and AP_Affiliates), so I switched back to this code in functions.php

 // Prefix with o_base_url (unless it's there already)
          if ($destination_url == '')
          $destination_url = 'index.php';

Re: Redirecting index.php

That's a bad idea, since the new code is there for security reasons wink

7 (edited by bingiman 2007-12-26 21:47)

Re: Redirecting index.php

I agree with you Smarty's but I posted a similar post a few weeks back and I don't even remember getting a response that solved the problem. When you use th eplugins as Patrik mentioned the affiliates URL does not open when you click the link, it basically takes you a blank page. The only solution was to leave the functions file the way it was.

btw: This also affects the Digg and del.ici.ous submissions as well.

footnote to all: In the Mega Pun (extras) folder, there is an updated functions.php file that you can use instead of the current one.

8 (edited by StevenBullen 2007-12-26 22:09)

Re: Redirecting index.php

@bingiman
Erm... Did you read the previous post.

Smartys wrote:

That's a bad idea, since the new code is there for security reasons wink

You should remove those things that dont work until you find a workaround, under no circumstances do you intentionally use security flawed code.
Your telling people a flaw in your software tongue

Re: Redirecting index.php

bingiman: The affiliates mod no longer works because the redirect function no longer redirects outside of the base URL.
The change does not affect Digg, etc: they have no relation to the function. That is probably due to the Bad Behavior mod.

Re: Redirecting index.php

You're right Smarty's about the Digg thing. My bad. Anyway, Will there eventually be a fix to this whole redirect thing?

11 (edited by StevenBullen 2007-12-26 23:58)

Re: Redirecting index.php

I very much doubt it in 1.2 because its not something that punbb vanilla requires.

Make sure that if you dont use the proper code that you make it clear to people that your giving them flawed code. Unfair otherwise tongue

Re: Redirecting index.php

@StevenBullen - Would you give it up already. Jesus Christ man! You made your point. I GET IT! MEGA PUN IS FLAWED. I will post a major announcement that life has to stop until this announcement is made. I am here trying to find a solution to a problem that pertains to Mega Pun and here you are going on and on like a recurring decimal. It will be announced when, and only when I see fit. If you feel the need to announce it to the world, then by all means do so. You are most certainly welcome to go onto http://shedrockonline.com and post about it.

Bingiman

Re: Redirecting index.php

Shut up bingiman. Your giving out code that is flawed so I can say what I like.

Maybe I should make it clear that any develeoper with this approach....

bingiman wrote:

The only solution was to leave the functions file the way it was.

I would not recommend anyway.

Is that better?

14 (edited by Smartys 2007-12-27 01:49)

Re: Redirecting index.php

Listen boss. I am no developer. I am just a guy trying to share my modified version of punBB so get that straight. Now, did the developers know at the time of writing the code that it was flawed code. NO, I don't think so. Give me a break. I am the only person working on Mega Pun. I don't see your ass helping out. Instead you are here criticizing me. Did you even bother to look on my website to see that this issue was addressed and that it was mentioned. Did you even know that an updated functions file was included in Mega Pun 3.01? []

[]

15 (edited by Smartys 2007-12-27 01:49)

Re: Redirecting index.php

[]

16 (edited by Smartys 2007-12-27 01:49)

Re: Redirecting index.php

[]

17 (edited by StevenBullen 2007-12-27 01:17)

Re: Redirecting index.php

Reported.
Sorry but I dont take abuse whilst helping punbb community.

EDIT: No more responses I am afraid. Like I said PunBB admins/mods can deal with this.

18 (edited by Smartys 2007-12-27 01:51)

Re: Redirecting index.php

Neither do I, and never forget that.

[]

19 (edited by bingiman 2007-12-27 01:19)

Re: Redirecting index.php

Also Reported.
Sorry, but I won't be treated like a child while trying to make the community better.

UPDATE: wise choice.

20 (edited by Utchin 2007-12-27 01:30)

Re: Redirecting index.php

To be fair bingiman, Stevenbullen feels that mega-pun 4.0 could be a worry for new users, who may have little knowledge of how this works. You didn't state what you were going to do once you had seen been told about the flaw, Post shows you "ignored it" and didn't mention it in your next post. As a new user i would of found this worrying that someone has noticed a flaw, and the developer has not commented it on.

And you started the name calling at #14, till then Stevenbullen could of been sarcastic in his replies but in my opinion not provoking the insults. You don't want abuse, don't give it!

Also Apologies Patrik For this wink

Sorry. Unactive due to personal life.

Re: Redirecting index.php

Oh dear, this got quite out of hand. hmm
I'm going to be editing posts a little bit to remove the name calling and I would like to remind EVERYONE that they should be behaving civilly toward each other. And that someone behaving poorly toward you does not entitle you to behave poorly toward them.

This topic is closed, since I believe the issue it originally referred to has been thoroughly addressed. If there are any more questions related to it, a new one may be created. No more bickering wink