Stop disabling super globals

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: Stop disabling super globals

Post by A_Jelly_Doughnut »

Prior to Symfony Forms 2.3.0, there was no DI available for the class David pointed out.

But, now, there is.
https://github.com/symfony/symfony/blob ... LOG.md#230
(See fourth bullet)
Also, the commit that implements the change

I haven't fully investigated the impllications, but in the 10 minutes I spent on this, it seems easy enough?

(@Exreaction: I didn't immediately see a branch at github.com/exreaction/phpbb3 that made me think "that's the right one", so I didn't look at your code at all, if it is published)
A_Jelly_Doughnut

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: Stop disabling super globals

Post by EXreaction »

Yes, I've been using that (it's an open, WIP PR, but I may not have pushed all of my local changes, it's been a while)

Perhaps it is simply something that was over-looked and needs to be fixed. I've opened a bug ticket on their tracker. https://github.com/symfony/symfony/issues/10009

sajaki
Registered User
Posts: 86
Joined: Mon Jun 21, 2010 8:28 pm

Re: Stop disabling super globals

Post by sajaki »

hi,
does this mean that in 3.1, this isset ( $_POST ['templatevariable'] won't work because there's no $_POST array anymore ?

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Stop disabling super globals

Post by imkingdavid »

sajaki wrote:hi,
does this mean that in 3.1, this isset ( $_POST ['templatevariable'] won't work because there's no $_POST array anymore ?
I believe isset() is allowed, but in 3.1 is it strongly recommended that you just use $request->is_set_post('templatevariable');
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 185
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: Stop disabling super globals

Post by Marc »

Please don't use globals like $_POST in 3.1. There are methods like $request->is_set() and $request->is_set_post().

User avatar
wintstar
Registered User
Posts: 108
Joined: Sun Dec 02, 2012 1:38 pm
Location: Gießen /Hessen Germany
Contact:

Re: Stop disabling super globals

Post by wintstar »

I have a problem with

Code: Select all

$this->setSessionIP($_SERVER['REMOTE_ADDR']);
Error message
Illegal use of $_SERVER. You must use the request class or request_var() to access input data. This error message was generated by deactivated_super_global.
Greeting Stephan :-)

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 185
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: Stop disabling super globals

Post by Marc »

Maybe use $request->server('REMOTE_ADDR')?

User avatar
wintstar
Registered User
Posts: 108
Joined: Sun Dec 02, 2012 1:38 pm
Location: Gießen /Hessen Germany
Contact:

Re: Stop disabling super globals

Post by wintstar »

Thanks Marc, but comes the next Error

Undefined variable: request
Greeting Stephan :-)

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 185
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: Stop disabling super globals

Post by Marc »

You have to use the global variable $request or pass the request class to your service container. It obviously won't work otherwise.

User avatar
wintstar
Registered User
Posts: 108
Joined: Sun Dec 02, 2012 1:38 pm
Location: Gießen /Hessen Germany
Contact:

Re: Stop disabling super globals

Post by wintstar »

Thanks Marc, that helps me to further.
Greeting Stephan :-)

Post Reply