Goodbye $phpEx

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.

Goodbye $phpEx

Postby igorw » 29 May 2008, 17:48

Meik (acyd burn) has made a monster commit today that filled up my inbox with 10 emails (they were split up). Here is the commit log:
ok... i hope i haven't messed too much with the code and everything is still working.
Changes:
- Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed.
- A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added.


This is probably the largest commit i have ever seen :o. I think even larger than the one where they moved to PHP 5.1. Our so beloved $phpEx is leaving us, and so is $phpbb_root_path. They are both being replaced by PHP_EXT and PHPBB_ROOT_PATH. I like the change, i think it's a good move. No more need to global them in every function. Allthough one good point that was pointed out by drathbun a while ago, is that you cannot use it in double quote strings directly anymore. So it's not possible to do:
Code: Select all
"{$phpbb_root_path}index.$phpEx"


The great thing though is that excactly this problem is addressed and makes it a lot easier, in fact. So instead of doing:
Code: Select all
append_sid("{$phpbb_root_path}index.$phpEx")

You can now simply do:
Code: Select all
append_sid('index')


So instead of making our lives more painful by forcing us to WRITE THE CONSTANT NAMES IN CAPS, it's improved that we actually have to type even less! :) Now that's what i like!

See the revision information page for all the changes, but believe me, you don't want to read through them. I like phpBB 3.1 more with every change :D.
User avatar
igorw
Past Contributor
Past Contributor
 
Posts: 2321
Joined: 01 Jun 2006, 20:48
Real name: Igor

Re: Goodbye $phpEx

Postby Semi_Deus » 29 May 2008, 18:23

Woa, that IS a big commit :shock:

Meik: :beer:
Image
Keep an eye on us, were back in business..
User avatar
Semi_Deus
Past Contributor
Past Contributor
 
Posts: 459
Joined: 28 Sep 2007, 23:52
Location: the Netherlands

Re: Goodbye $phpEx

Postby Ganon_Master » 29 May 2008, 19:42

That's great. And the URL parameters are still taken care off the same way?
Image
User avatar
Ganon_Master
Past Contributor
Past Contributor
 
Posts: 330
Joined: 20 Nov 2006, 16:23
Location: Soesterberg, Utrecht, The Netherlands
Real name: Hidde

Re: Goodbye $phpEx

Postby igorw » 29 May 2008, 19:54

Yes, the rest is the same :).
User avatar
igorw
Past Contributor
Past Contributor
 
Posts: 2321
Joined: 01 Jun 2006, 20:48
Real name: Igor

Re: Goodbye $phpEx

Postby harmlessgoat22 » 01 Jun 2008, 16:27

Great idea on their part. I'm happy with the change.
Image
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
harmlessgoat22
Supporter
Supporter
 
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David

Re: Goodbye $phpEx

Postby Prince of phpBB » 01 Jun 2008, 21:19

Like the changes .. Love Ascraeus 8-)
User avatar
Prince of phpBB
Supporter
Supporter
 
Posts: 37
Joined: 23 Jul 2006, 00:27
Location: Manchester, UK
Real name: Aadi

Re: Goodbye $phpEx

Postby mtotheikle » 02 Jun 2008, 00:06

I love this move as well, even though all MOD's will have to be updated now, it makes everything more secure than ever before by even though phpBB has ways to block register globals, some site still have the setting on and bridges or MOD's may get passed the phpBB way of disabling them making the site vulnerably in ways again. Again it is a great update and will make sites a little more secure in my views.
mtotheikle
New member
New member
 
Posts: 25
Joined: 11 Oct 2007, 03:03
Location: Spokane, WA
Real name: Mike

Re: Goodbye $phpEx

Postby Obsidian » 02 Jun 2008, 12:44

Ow ow ow ow, jaw hurts, it hit the floor at supersonic speed. :shock:
User avatar
Obsidian
Supporter
Supporter
 
Posts: 867
Joined: 13 May 2008, 15:20
Real name: Damian

Re: Goodbye $phpEx

Postby Brandon » 02 Jun 2008, 21:43

Wow that is a big change. Must be a pain trying to remember all these coding tags I mean I would forget in an instant! :lol:
Image
array(
'Brandon' => ' VALIDATE_USER ',
),
User avatar
Brandon
Member
Member
 
Posts: 63
Joined: 08 Apr 2008, 00:11
Location: USA
Real name: Brandon

Re: Goodbye $phpEx

Postby harmlessgoat22 » 03 Jun 2008, 20:44

I hope Miek used Dreamweaver or some other program that can search through whole folders at a time for stuff...that would have helped a ton in looking for everywhere $phpEx and $phpbb_root_path are used.
Image
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
harmlessgoat22
Supporter
Supporter
 
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David

Re: Goodbye $phpEx

Postby Brandon » 04 Jun 2008, 00:05

Oh yes Dreamweaver would be excellent for that certain occasion. :D
Image
array(
'Brandon' => ' VALIDATE_USER ',
),
User avatar
Brandon
Member
Member
 
Posts: 63
Joined: 08 Apr 2008, 00:11
Location: USA
Real name: Brandon

Re: Goodbye $phpEx

Postby momentum » 04 Jun 2008, 00:19

grep

Craig.
User avatar
momentum
New member
New member
 
Posts: 37
Joined: 28 Feb 2008, 04:54
Location: Melbourne, Australia
Real name: Craig

Re: Goodbye $phpEx

Postby Obsidian » 04 Jun 2008, 12:30

Waiiit a minute...

Then how are MOD authors supposed to write scripts for use in subdirectories? :?
User avatar
Obsidian
Supporter
Supporter
 
Posts: 867
Joined: 13 May 2008, 15:20
Real name: Damian

Re: Goodbye $phpEx

Postby Ganon_Master » 04 Jun 2008, 16:28

sTraTo wrote:Waiiit a minute...

Then how are MOD authors supposed to write scripts for use in subdirectories? :?


The append_sid function allows for short notation, but includes still have to be done the (sort of) old fashion way.

Code: Select all
include(PHPBB_ROOT_PATH 'includes/functions.' PHP_EXT);  
Image
User avatar
Ganon_Master
Past Contributor
Past Contributor
 
Posts: 330
Joined: 20 Nov 2006, 16:23
Location: Soesterberg, Utrecht, The Netherlands
Real name: Hidde

Re: Goodbye $phpEx

Postby harmlessgoat22 » 04 Jun 2008, 20:22

You could also still use the shorthand:
Code: Select all
append_sid('includes/functions.'); 

Just like including a language file, you can put folders in there.
Image
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
harmlessgoat22
Supporter
Supporter
 
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David

Next

Return to phpBB Development discussion

Who is online

Users browsing this forum: No registered users and 0 guests