Aux réfractaires aux changements

malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 - 10 mars 2006 à 18:10
thomvaill Messages postés 366 Date d'inscription mercredi 7 avril 2004 Statut Membre Dernière intervention 20 février 2007 - 12 mars 2006 à 19:57
Hello tlm,

j'ai décidé de copier ici un petit bout des changements prévus pour PHP6...histoire de mettre un terme à certains débats, sur "Chez moi, Jn'utilise pas addslashes, j'ai les magic_quote à on, $var au lieu de $_POST['var'] c'est plus simple, et ça marche, pas besoin de déclarer une variable avant de l'utiliser, par défaut php n'affiche pas ces warning, etc..." :




2.1 register_globals

Issue: Register globals are the source of many application's security problems and cause a constant grief.


Discussion: We shortly discussed how we want to attend users on the disappearance of this functionality. We decided that if we find the setting during the startup of PHP we raise an E_CORE_ERROR which will prevent the server from starting with a message that points to the documentation. The documentation should explain why this functionality was removed, and some introduction on safe programming.


Conclusions:


<OL simple?>
<LI>We are going to remove the functionality.</LI>
<LI>We throw an E_CORE_ERROR when starting PHP and when we detect the register_globals setting</LI></OL>

2.2 magic_quotes

Issue: Magic_quotes can be cumbersome for application developers as it is a setting that can be set to on or off without any influence from within the script itself as input parameters are escaped before the script starts.


Discussion: In the same way as with the remove of the register_globals functionality, we decided that if we find the setting during the startup of PHP we raise an E_CORE_ERROR which will prevent the server from starting with a message that points to the documentation. The documentation should explain why this functionality was removed, and point the users at the input_filter extension as replacement.


Conclusions:




<OL simple?>
<LI>We remove the magic_quotes feature from PHP.</LI>
<LI>We throw an E_CORE_ERROR when starting PHP and when we detect the magic_quotes, magic_quotes_sybase or magic_quotes_gpc setting.</LI></OL>

2.11 register_long_arrays, HTTP_*_VARS

Issue: register_long_arrays and the long versions of the super globals have been deprecated since some time, and do not serve a real purpose.


Discussion: The $_GET[], $_POST[], etc style superglobals are a better alternative since they are shorter and have the same behavior. The register_long_arrays option is also off by default making it less of a problem to remove this.


Conclusions:




<OL simple?>
<LI>We remove the register_long_arrays setting and HTTP_*_VARS globals from PHP.</LI>
<LI>We throw an E_CORE_ERROR when starting PHP and when we detect the register_long_arrays setting.</LI></OL>

6.6 E_STRICT on by default

Issue: PHP's E_STRICT error level is meant to point users to language level warnings/errors. E_STRICT is currently not part of E_ALL and thus often those E_STRICT messages will be hidden from users.


Discussion: As we want to expose the language level warnings a bit more, and because of having all error levels in E_ALL, except E_STRICT is confusing we will be adding E_STRICT to E_ALL. As the current default is E_ALL & ~E_NOTICE we will effectively turn on E_STRICT by default.


Conclusions:




<OL simple?>
<LI>We add E_STRICT to E_ALL</LI></OL>


Etc etc...

MAIS, malheureusement (et curieusement ) :




6.7 Remove support for <?, <% and <script language= "PHP"> and add "<?php =$var?>"

Issue :


Discussion:


Conclusions:


<OL simple?>
<LI>We kill "<%" but keep "<?".</LI>
<LI>Jani will prepare a patch that disallows mixing different open/close tags.</LI>
<LI>We will not add "<?php =".</LI></OL>

18 réponses

FhX Messages postés 2350 Date d'inscription mercredi 13 octobre 2004 Statut Membre Dernière intervention 18 avril 2015 3
10 mars 2006 à 19:34
Ouais... bah tant mieux les changements.
Bon y'en a encore un paquet mais c'est déja pas mal !
0
coockiesch Messages postés 2268 Date d'inscription mercredi 27 novembre 2002 Statut Membre Dernière intervention 13 septembre 2013 4
10 mars 2006 à 19:55
Héhé, enfin! :)

@++

R@f

www.allpotes.ch: Photos, humour, vidéos, gags, ...

"On dit que seulement 10 personnes au monde comprenaient Einstein. Personne ne me comprends. Suis-je un génie???"
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
10 mars 2006 à 21:57
add "<?php = $var?>"
Pffff, ils en ont pas marre avec leurs raccourcis nazes...

<hr size ="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
10 mars 2006 à 23:04
Nan nan antho : WILL NOT ADD, y a marqué ;-)
Mais ils gardent <?...à l'heure du xhtml et donc du xml, j'avoue que je ne pige pas cette décision.
Enfin si...pour laisser encore du temps à ceux qui ont codé leur site avec cette abbréviation, et en html 4...mais bon...

Le lien complet, même si on le trouve très facilement depuis pas mal de temps sur le net :
http://www.php.net/~derick/meeting-notes.html
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
10 mars 2006 à 23:10
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
10 mars 2006 à 23:13
"Remove support for <?, <% and <script language="PHP"> and add "<?php =$var?>""
heu... ?
<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
10 mars 2006 à 23:17
Voui mais t'as :
-le titre
- description du problème
- résumé des discussions
- les conclusions. Et dans les conclusions :
Conclusions:

<ol simple=""><li>We kill "<%" but keep "<?".</li><li>Jani will prepare a patch that disallows mixing different open/close tags.</li><li>We will not add "<?php =".</li></ol>;-)
bref, ils ne le feront pas, mais ça a été demandé quand même, y a des gens tordus!

De ttes façons, c'est pas pour tout de suite php6...je pense qu'on a le temps de voir évoluer tout ça.
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
10 mars 2006 à 23:19
Pour les réfractaires à l'anglais:
on vire <%
on garde <?
on n'autorisera pas le mélange des tags (un coup <?, un coup <?php...nan!)
on n'ajoute pas <?php=$var
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
10 mars 2006 à 23:54
tant mieux, de toute façon PHP5 n'étant déjà pas implémenté partout, on parle déjà de PHP6, ça aura pas fait long feu...

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
10 mars 2006 à 23:59
C'est clair, je trouve que c'est une sortie très rapide...mais si c'est un 6, c'est qu'il y a de gros changements, probablement au niveau du moteur (j'ai pas trouvé encore lol).
Mais c'est vraiment rapide quand même...
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
11 mars 2006 à 00:11
J'espère qu'il sera vraiment plus rapide à analyser les scripts, pas à sortir pour laisser place à PHP 7 (quoi que le SEPT c'est un bon chiffre mais bon voilà quoi) lol

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
FhX Messages postés 2350 Date d'inscription mercredi 13 octobre 2004 Statut Membre Dernière intervention 18 avril 2015 3
11 mars 2006 à 08:51
Ouais j'avais lu pour les propriétés Objets, ce qui m'interesse le plus quoi.
Y'a rien de bien nouveau :/
0
thomvaill Messages postés 366 Date d'inscription mercredi 7 avril 2004 Statut Membre Dernière intervention 20 février 2007 2
11 mars 2006 à 12:46
J'ai jamais capté à quoi ça servait register_globals et magic_quotes :/



Et si non le raccourcis : <?php =$var?> Ca fait echo($var); ? Beurkk
Thomvaill
IRC : Thomas (irc.heliosnet.org:6667 #programmation)
0
FhX Messages postés 2350 Date d'inscription mercredi 13 octobre 2004 Statut Membre Dernière intervention 18 avril 2015 3
12 mars 2006 à 13:41
register_globals :

$_POST['var'] = $_GET['var'] = $_COOKIE['var'] = $var
Voila ce qui se passe quand tu met register_globals à ON.

magic_quotes :

$chaine = "Salut, c'est trop cool comme truc !";
$chaine_apres_soumission_formulaire = "Salut, c\'est trop cool comme truc !";
Voila ce qui se passe quand tu met magic_quotes à ON. Je te laisse le soin d'imaginer les trous de sécurités quand tu le mets à OFF :)
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
12 mars 2006 à 14:11
ouais mais c'est moisi quand même les magic quotes, ça saoule à la longue, ils auraient pu les laisser soit à on soit à off mais sans possibilité de modification, c'est lourdingue...

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
FhX Messages postés 2350 Date d'inscription mercredi 13 octobre 2004 Statut Membre Dernière intervention 18 avril 2015 3
12 mars 2006 à 14:17
Ca sert à rien de toute facon...

Sachant que tu fais un escape_string() avant toute entrée dans la base de donnée, ca sert pas à grand chose.
En faite, ca a été inventé pour les gars qui codent à l'arraché je crois... genre ceux qui trouvais que mysql_escape_string() était trop long à écrire lol :)
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
12 mars 2006 à 14:51
lol ^^ addslashes power (et mysql_real_escape_string() power)

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
thomvaill Messages postés 366 Date d'inscription mercredi 7 avril 2004 Statut Membre Dernière intervention 20 février 2007 2
12 mars 2006 à 19:57
Oua j'avais jamais vu "register_globals" là.. Trop laid l'truc...

Thomvaill
IRC : Thomas (irc.heliosnet.org:6667 #programmation)
0
Rejoignez-nous