Goodbye $phpEx

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor

Goodbye $phpEx

Post by igorw »

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 [url=http://code.phpbb.com/repositories/revision/5?rev=8572]revision information[/url] 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
Semi_Deus
Past Contributor
Past Contributor
Posts: 405
Joined: 28 Sep 2007, 23:52
Location: the Netherlands
Contact:

Re: Goodbye $phpEx

Post by Semi_Deus »

Woa, that IS a big commit :shock:

Meik: :beer:
Image
Keep an eye on us, were back in business..
Ganon_Master
Past Contributor
Past Contributor
Posts: 311
Joined: 20 Nov 2006, 16:23
Real name: Hidde
Location: Soesterberg, Utrecht, The Netherlands
Contact:

Re: Goodbye $phpEx

Post by Ganon_Master »

That's great. And the URL parameters are still taken care off the same way?
Image
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor

Re: Goodbye $phpEx

Post by igorw »

Yes, the rest is the same :).
harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Goodbye $phpEx

Post by harmlessgoat22 »

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
User avatar
Prince of phpBB
Supporter
Supporter
Posts: 36
Joined: 23 Jul 2006, 00:27
Real name: Aadi
Location: Manchester, UK
Contact:

Re: Goodbye $phpEx

Post by Prince of phpBB »

Like the changes .. Love Ascraeus 8-)
mtotheikle
New member
New member
Posts: 25
Joined: 11 Oct 2007, 03:03
Real name: Mike
Location: Spokane, WA
Contact:

Re: Goodbye $phpEx

Post by mtotheikle »

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.
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Goodbye $phpEx

Post by Obsidian »

Ow ow ow ow, jaw hurts, it hit the floor at supersonic speed. :shock:
User avatar
Brandon
Member
Member
Posts: 62
Joined: 08 Apr 2008, 00:11
Real name: Brandon
Location: USA
Contact:

Re: Goodbye $phpEx

Post by Brandon »

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 ',
),
harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Goodbye $phpEx

Post by harmlessgoat22 »

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
User avatar
Brandon
Member
Member
Posts: 62
Joined: 08 Apr 2008, 00:11
Real name: Brandon
Location: USA
Contact:

Re: Goodbye $phpEx

Post by Brandon »

Oh yes Dreamweaver would be excellent for that certain occasion. :D
Image
array(
'Brandon' => ' VALIDATE_USER ',
),
momentum
New member
New member
Posts: 32
Joined: 28 Feb 2008, 04:54
Real name: Craig
Location: Melbourne, Australia
Contact:

Re: Goodbye $phpEx

Post by momentum »

[url=http://en.wikipedia.org/wiki/Grep]grep[/url]

Craig.
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Goodbye $phpEx

Post by Obsidian »

Waiiit a minute...

Then how are MOD authors supposed to write scripts for use in subdirectories? :?
Ganon_Master
Past Contributor
Past Contributor
Posts: 311
Joined: 20 Nov 2006, 16:23
Real name: Hidde
Location: Soesterberg, Utrecht, The Netherlands
Contact:

Re: Goodbye $phpEx

Post by Ganon_Master »

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
harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Goodbye $phpEx

Post by harmlessgoat22 »

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
Post Reply