Am 03.11.15 um 20:07 schrieb Andrea Faulds:
> Hi Andreas,
> 
> Andreas Heigl wrote:
>> +1 on that solution. Just throwing "host:port" onto something doesn't
>> help anyone. Try that with "www.google.com:443" in your favourite
>> browser. Most will give you an error (if it's not port 80). So those
>> people that try it will eventually read the documentation on php.net and
>> then see that it's not supported.
> 
> If you give the port number for a non-HTTP TCP application then yes,
> your browser will spit an error back at you, because HTTP is the
> implicit URI scheme. That doesn't mean hostname:port is wrong, it's
> perfectly valid for HTTP. Similarly, I could give my LDAP URI as
> google.com:80 and get an error, but I don't think that's a fault with
> hostname:port.
> 
> The PHP interpreter itself uses it for HTTP:
> 
> $ php -S localhost:8000
> 
> I'm unconvinced.

Hi Andrea.

The documentation mentions two different ways of using ldap_connect:
either with 2 parameters being host and port (from which the port is
optional) or with a single parameter using an LDAP-URI. There is a third
possibility mentioned in one of the comments of passing in a string of
multiple LDAP-URIs separated by a space. But I couldn't find a mention
of "host:port".

As there is an explicit mention of an URI the scheme is mandatory. And
as the scheme is used to differentiate between ldap and ldaps it's a
somewhat different story than the paramteter to phps internal server as
that one ONLY serves http (AFAIK). And it is explicitly stated that the
first version of ldap_connect with two parameters *only* allows
connections via ldap (not ldaps). If you want to use ldaps as scheme you
are required to use the second form with the LDAP-URI. So if someone
passes a single parameter 'host:port' to ldap_connect I'm sure they want
to use ldaps as protocol?

In my eyes the main question is whether we want to support something
that was never intended and nowhere documented just because someone
tried something and by luck didn't break something. I'd consider the
possibility to pass 'host:port' as single parameter to ldap_connect as a
bug and not as a feature. Therefore I'd rather see that bug fixed sooner
than later. And have the documentation point out explicitly that using
'host:port' without a scheme is NOT supported even though it might have
once worked.

Cheers

Andreas
-- 
                                                              ,,,
                                                             (o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl                                                       |
| mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org                       http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca                                               |
+---------------------------------------------------------------------+


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to