Subversion Repositories Applications.framework

Rev

Rev 304 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 304 Rev 404
Line 10... Line 10...
10
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
10
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
11
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
12
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
12
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
13
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
13
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
14
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
14
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
15
 * @version	SVN: $Id: Url.php 286 2011-01-05 11:37:57Z jpm $
15
 * @version	SVN: $Id: Url.php 404 2012-02-22 15:44:24Z gduche $
16
 * @link		/doc/framework/
16
 * @link		/doc/framework/
17
*/
17
*/
18
class Url {
18
class Url {
Line 19... Line 19...
19
 
19
 
Line 24... Line 24...
24
 
24
 
25
	/**
25
	/**
26
	 * URL-encoder les clés des variables dans les requêtes. Par défaut à true.
26
	 * URL-encoder les clés des variables dans les requêtes. Par défaut à true.
27
	 */
27
	 */
-
 
28
	const OPTION_ENCODER_CLES = 'encoder_cles';
-
 
29
	
-
 
30
	/**
-
 
31
	* URL-encoder les valeurs des variables dans les requêtes. Par défaut à false.
-
 
32
	*/
Line 28... Line 33...
28
	const OPTION_ENCODER_CLES = 'encoder_cles';
33
	const OPTION_ENCODER_VALEURS = 'encoder_valeurs';
29
 
34
 
30
	/**
35
	/**
31
	 * Séparateurs de variables lors du parsing de la requête. Chaque caractère
36
	 * Séparateurs de variables lors du parsing de la requête. Chaque caractère
Line 45... Line 50...
45
	 * vis à vis de $_GET
50
	 * vis à vis de $_GET
46
	 */
51
	 */
47
	private $options = array(
52
	private $options = array(
48
		self::OPTION_UTILISER_CROCHETS => true,
53
		self::OPTION_UTILISER_CROCHETS => true,
49
		self::OPTION_ENCODER_CLES => true,
54
		self::OPTION_ENCODER_CLES => true,
-
 
55
		self::OPTION_ENCODER_VALEURS => false,
50
		self::OPTION_SEPARATEUR_ENTREE => '&',
56
		self::OPTION_SEPARATEUR_ENTREE => '&',
51
		self::OPTION_SEPARATEUR_SORTIE => '&');
57
		self::OPTION_SEPARATEUR_SORTIE => '&');
Line 52... Line 58...
52
 
58
 
53
	/**
59
	/**
Line 267... Line 273...
267
		} else {
273
		} else {
268
			foreach ($parametres as $nom => $valeur) {
274
			foreach ($parametres as $nom => $valeur) {
269
				if ($this->getOption(self::OPTION_ENCODER_CLES)) {
275
				if ($this->getOption(self::OPTION_ENCODER_CLES)) {
270
					$nom = rawurlencode($nom);
276
					$nom = rawurlencode($nom);
271
				}
277
				}
-
 
278
				
-
 
279
				if ($this->getOption(self::OPTION_ENCODER_VALEURS)) {
-
 
280
					$valeur = rawurlencode($valeur);
-
 
281
				}
Line 272... Line 282...
272
 
282
 
273
				if (is_array($valeur)) {
283
				if (is_array($valeur)) {
274
					foreach ($valeur as $k => $v) {
284
					foreach ($valeur as $k => $v) {
275
						if ($this->getOption(self::OPTION_UTILISER_CROCHETS)) {
285
						if ($this->getOption(self::OPTION_UTILISER_CROCHETS)) {