Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
A PHP fork?
« on June 15th, 2011, 07:29 PM »
http://www.xarg.org/2011/06/php-hacking/

I'm staring at this and quietly thinking 'why in god's name weren't some of these implemented in PHP itself?'

I mean, [] syntax for arrays, various string/array enhancements and optimisations. Plus he really took some brave moments with forcibly kicking out register-globals and magic quoting instead of them being deprecated. And, for the love of all things holy, he's made UTF-8 the default! (About fucking time. ISO-8859-1, or CP1251, or other character sets... not default.)

I'm not sure about this being really deployed (I think PHP is perhaps too entrenched at the moment) but it does feel like he's doing it because he's frustrated with the way PHP is being developed - and doesn't that sound familiar? ;)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Eros

  • I has a thought. Be afraid.
  • Posts: 56
Re: A PHP fork?
« Reply #1, on June 15th, 2011, 07:45 PM »
It does sound familiar but by the same token...

I'm not sure I'd use it simply because I'm not sure I trust him to maintain it yet and PHP really needs a complete rebuild for PHP 6, which is not where he is going.

18+ Roleplay Forum <- hopefully running Wedge when it is ready.

Yaoi RP Forum <- hopefully running Wedge when it is ready.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #2, on June 15th, 2011, 07:53 PM »
If you read what he has to say, though, he'd love to contribute this stuff to 5.3/5.4 but the powers that be are kicking stuff back - if I contribute a patch to something, I don't expect to have to wait a year for it to be evaluated. This did, unfortunately, happen with SMF (though it was more like 6 months rather than a year)

Yes, PHP 6 needs a fresh build and that's not where he's going, but he acknowledges that fact - it is more about raising awareness right now.

Eros

  • I has a thought. Be afraid.
  • Posts: 56
Re: A PHP fork?
« Reply #3, on June 15th, 2011, 09:01 PM »
Quote from Arantor on June 15th, 2011, 07:53 PM
If you read what he has to say, though, he'd love to contribute this stuff to 5.3/5.4 but the powers that be are kicking stuff back - if I contribute a patch to something, I don't expect to have to wait a year for it to be evaluated. This did, unfortunately, happen with SMF (though it was more like 6 months rather than a year)
I understand that. However, a single developer, sometimes has RL issues or loses interest or whatever. If you take advantage of some of the non-compatible changes and something happens to kill development, you'll either need to take over or go back to the main PHP branch.

If he had  a core group of 2-3 people, I'd be more willing to switch since if someone gets hit by car I don't have to switch back. Maybe that is just me tho. I'm lazy.
Quote
Yes, PHP 6 needs a fresh build and that's not where he's going, but he acknowledges that fact - it is more about raising awareness right now.
I know. I'm just saying I'm not sure it is worth the hassle if in a couple of years, PHP 6 will be what is adopted anyway.

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: A PHP fork?
« Reply #4, on June 15th, 2011, 11:37 PM »
Wow, I've been reading an it has lots of cool stuff. I'm gonna give it a go in localhost...

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: A PHP fork?
« Reply #5, on June 16th, 2011, 01:24 AM »
It looks as if $_REQUEST is disabled by default which might cause problems with "SMF since it uses that. But deep inside its bowels it declares $_REQUEST = $_GET + $_POST
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #6, on June 16th, 2011, 01:32 AM »
And that's something I think is quite good ;)

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: A PHP fork?
« Reply #7, on June 16th, 2011, 01:40 AM »
Yeah. I have always used $_GET and $_POST prior to SMF.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #8, on June 16th, 2011, 01:43 AM »
Oh, well, I came from ASP Classic prior to PHP, so the REQUEST concept was nothing new. What I like is that SMF explicitly sanitises REQUEST regardless of anything else, so it honestly makes no difference for SMF or Wedge for this fork.

snoopy-virtual

  • Posts: 152
Re: A PHP fork?
« Reply #9, on June 16th, 2011, 11:13 AM »
And what happen with SESSION?

It should be $_REQUEST = $_GET + $_POST + $_SESSION

Or maybe he is doing it on purpose to get rid of the SESSION inside the REQUEST, but why? (thinking out loud)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #10, on June 16th, 2011, 11:40 AM »
Um, no it shouldn't. REQUEST out of the box would normally be GET, POST and COOKIE. And therein is the reason why REQUEST is unsafe without pre filtering like SMF does.

snoopy-virtual

  • Posts: 152
Re: A PHP fork?
« Reply #11, on June 16th, 2011, 01:09 PM »
Sorry.

You are right.

I was sorting something else involving sessions and somehow I wrote it instead of cookies. Must be the Alzheimer.

A couple of days ago, for example, playing chess with my 14 years old son, I was too concentrate defending a pawn and forgot completely to defend the queen. Lost the game, of course.  :lol:
Posted: June 16th, 2011, 01:04 PM

Anyway, what I meant is why he want to get rid of the $_COOKIE inside $_REQUEST instead of sanitize it?

Even leaving only GET and POST he would need to filter it as well to avoid some attacks.
Posted: June 16th, 2011, 01:07 PM

Treat the cookies in a completely separate way?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #12, on June 16th, 2011, 01:26 PM »
SMF ditches COOKIE from REQUEST. With good reason: minimising data taint. People who are not tech savvy invariably use REQUEST for everything. I know I did when I first came to PHP.

Consider, for a moment, the implications of using REQUEST for everything. You cannot verify the source of anything, the very first line of defence against CSRF is gone, and if you're using REQUEST rather than COOKIE you even risk adding session fixation to your vulnerability list, just for starters.

Forcing users to use GET and POST, rather than an ambiguous source is a nice step, though honestly I'd love to see a proper taint detection method such as in Perl, where you explicitly can't do anything to input without some kind of sanity check first.

CJ Jackson

  • I got myself a new iPad, a different world to the iPhone!
  • Posts: 241
Re: A PHP fork?
« Reply #13, on June 16th, 2011, 05:41 PM »
Quote from live627 on June 16th, 2011, 01:24 AM
$_REQUEST = $_GET + $_POST
I did that with my plugin, except I called it $param, because I'm used to the word param. ($param = array_merge($_GET,$_POST)).

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A PHP fork?
« Reply #14, on June 16th, 2011, 05:48 PM »
And you're explicitly distrusting the original contents in favour of something more reliable. ;)