deactivated_super_global screws up my website

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
joakim.aberg
Registered User
Posts: 60
Joined: Mon Dec 01, 2014 2:25 pm

deactivated_super_global screws up my website

Post by joakim.aberg »

I have managed to make a cross-site login, but when I login (and thus become logged in on the phpBB forum and my website via a separate session) and start to browse my own website, that uses POST and GET, phpBB is screwing things up with huge errormessages regarding the POST and GET.

I guess since the phpBB session is active, it filters everything through this deactivated_super_global function. How can I turn this off for the rest of my website?.. actually I dont get why it is filtering anything that has nothing to do with the forum..
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26919
Joined: Fri Aug 29, 2008 9:49 am

Re: deactivated_super_global screws up my website

Post by Mick »

Please post the error messages you're getting preferably in code tags.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
joakim.aberg
Registered User
Posts: 60
Joined: Mon Dec 01, 2014 2:25 pm

Re: deactivated_super_global screws up my website

Post by joakim.aberg »

Two error messages:

Code: Select all

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\wamp\www\ASFF\template.php:103) in C:\Program Files\wamp\www\ASFF\phpBB3\includes\functions.php on line 2498

Code: Select all

General Error
Illegal use of $_GET. You must use the request class or request_var() to access input data. Found in C:\Program Files\wamp\www\ASFF\gallery.php on line 135. This error message was generated by deactivated_super_global.

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 67
CALL: trigger_error()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 87
CALL: phpbb\request\deactivated_super_global->error()

FILE: C:/Program Files/wamp/www/ASFF/gallery.php
LINE: 135
CALL: phpbb\request\deactivated_super_global->offsetGet()

FILE: C:/Program Files/wamp/www/ASFF/template.php
LINE: 145
CALL: include('C:/Program Files/wamp/www/ASFF/gallery.php')

FILE: C:/Program Files/wamp/www/ASFF/index.php
LINE: 51
CALL: include('C:/Program Files/wamp/www/ASFF/template.php')
The link I clicked on my webpage was this:

Code: Select all

http://localhost/ASFF/index.php?gallery=&category=none
So, it redirects to the gallery in my main page, with a variable for GET.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26919
Joined: Fri Aug 29, 2008 9:49 am

Re: deactivated_super_global screws up my website

Post by Mick »

What are you using to edit your files? In the first error it looks like you've been editing template.php and left a BOM, space or CR at the beginning of the file. See Knowledge Base - phpBB3 and UTF-8 without BOM and Knowledge Base - Tools needed to set up and customise phpBB
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
joakim.aberg
Registered User
Posts: 60
Joined: Mon Dec 01, 2014 2:25 pm

Re: deactivated_super_global screws up my website

Post by joakim.aberg »

I edit my files in NetBeans. The structure looks like this:

index.php
include template.php

template.php
include content.php

I've read about the BOM but dont rly understand how to look for it. Wouldn't this cause a problem without phpBB on my site?

Btw, the css file for gallery.php doesn't work when these messages pop up..
joakim.aberg
Registered User
Posts: 60
Joined: Mon Dec 01, 2014 2:25 pm

Re: deactivated_super_global screws up my website

Post by joakim.aberg »

I've played around with the site and it has nothing to do with the header error message, or a BOM.

I can't use any superglobals on my own site anymore. Doesnt matter if I'm logged in to the phpBB forum or not. Why does some function in phpBB even bother if I use superglobals in totally different php files..
joakim.aberg
Registered User
Posts: 60
Joined: Mon Dec 01, 2014 2:25 pm

Re: deactivated_super_global screws up my website

Post by joakim.aberg »

Fixed it.. turned of deactivating super globals in parameters.yml..

your not making it ease for us users I must say.. but i understand why your implementing those functions. But you should rly fix it so that the phpBB forum just cares about whats in the phpBB folder and not messing around with other files..
innocentdevil73
Registered User
Posts: 2
Joined: Tue Dec 24, 2013 9:11 am

Re: deactivated_super_global screws up my website

Post by innocentdevil73 »

I got similar problem, however it is now resolved. What i was doing wrong was

"To Not Delete the old files from the server as stated in the update."

As soon as I deleted the files, everything was working absolutely fine.
Darkseal
Registered User
Posts: 1
Joined: Sun Oct 30, 2016 11:59 pm

Re: deactivated_super_global screws up my website

Post by Darkseal »

Trying to stick to best-practice is what I always do in most cases: however, there are some rare scenarios when using the request class isn't possible, for example when you're dealing with existing, pre-3.1 phpBB implementations and you want to upgrade the forum without having to mess with a PHP script that you either don't own, know or are allowed to change.

When such situations arise, phpBB 3.1.x gives you the chance to re-enable superglobals either globally or programmatically:

GLOBALLY
Open the /phpbb/config/parameters.yml file and change the core.disable_super_globals key from true to false.

Programmatically
This is a sample code that can be used to temporarily enable superglobals (per-request scope):

Code: Select all

// temporarily enable superglobals
$request->enable_super_globals();

// TODO: do your stuff here.

// disable superglobals again
$request->disable_super_globals();
You can also read this post for further info about this topic, such as how to do this when you're upgrading from phpBB 3.0.x or below.
spacebiscuit
Registered User
Posts: 38
Joined: Thu Nov 17, 2011 10:36 am

Re: deactivated_super_global screws up my website

Post by spacebiscuit »

Darkseal wrote: Mon Oct 31, 2016 12:05 am Programmatically
This is a sample code that can be used to temporarily enable superglobals (per-request scope):

Code: Select all

// temporarily enable superglobals
$request->enable_super_globals();

// TODO: do your stuff here.

// disable superglobals again
$request->disable_super_globals();
Thanks - but this doesn't work.

Fatal error: Call to a member function enable_super_globals() on a non-object in

Having spent half the day working on a login script that makes use of my phpbb users' table I'm stuck fighting this issue, very frustrating!
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52808
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve

Re: deactivated_super_global screws up my website

Post by stevemaury »

This is a 3 year old topic marked "solved" which was never really a phpBB support topic. Please start a new topic. Closing.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Return to “[3.1.x] Support Forum”