1 |
<?php
|
1 |
<?php
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This file is part of eRibo. |
|
8 |
// | This file is part of eRibo. |
|
9 |
// | |
|
9 |
// | |
|
10 |
// | Foobar is free software; you can redistribute it and/or modify |
|
10 |
// | Foobar is free software; you can redistribute it and/or modify |
|
11 |
// | it under the terms of the GNU General Public License as published by |
|
11 |
// | it under the terms of the GNU General Public License as published by |
|
12 |
// | the Free Software Foundation; either version 2 of the License, or |
|
12 |
// | the Free Software Foundation; either version 2 of the License, or |
|
13 |
// | (at your option) any later version. |
|
13 |
// | (at your option) any later version. |
|
14 |
// | |
|
14 |
// | |
|
15 |
// | Foobar is distributed in the hope that it will be useful, |
|
15 |
// | Foobar is distributed in the hope that it will be useful, |
|
16 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
// | GNU General Public License for more details. |
|
18 |
// | GNU General Public License for more details. |
|
19 |
// | |
|
19 |
// | |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
24 |
// CVS : $Id: eribo_encodage.fonct.php,v 1.1 2005-01-18 12:14:24 jpm Exp $
|
24 |
// CVS : $Id: eribo_encodage.fonct.php,v 1.2 2005-03-15 12:18:30 jpm Exp $
|
25 |
/**
|
25 |
/**
|
26 |
* Fonctions manipulant les encodages
|
26 |
* Fonctions manipulant les encodages
|
27 |
*
|
27 |
*
|
28 |
* Fichiers contenant des fonctions manipulant l'encodage.
|
28 |
* Fichiers contenant des fonctions manipulant l'encodage.
|
29 |
*
|
29 |
*
|
30 |
*@package eRibo
|
30 |
*@package eRibo
|
31 |
*@subpackage Fonctions
|
31 |
*@subpackage Fonctions
|
32 |
//Auteur original :
|
32 |
//Auteur original :
|
33 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
33 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
34 |
//Autres auteurs :
|
34 |
//Autres auteurs :
|
35 |
*@author Aucun
|
35 |
*@author Aucun
|
36 |
*@copyright Tela-Botanica 2000-2004
|
36 |
*@copyright Tela-Botanica 2000-2004
|
37 |
*@version $Revision: 1.1 $ $Date: 2005-01-18 12:14:24 $
|
37 |
*@version $Revision: 1.2 $ $Date: 2005-03-15 12:18:30 $
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
*/
|
39 |
*/
|
40 |
|
40 |
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// | ENTETE du PROGRAMME |
|
42 |
// | ENTETE du PROGRAMME |
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
44 |
|
44 |
|
45 |
|
45 |
|
46 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
// +------------------------------------------------------------------------------------------------------+
|
47 |
// | LISTE DES FONCTIONS |
|
47 |
// | LISTE DES FONCTIONS |
|
48 |
// +------------------------------------------------------------------------------------------------------+
|
48 |
// +------------------------------------------------------------------------------------------------------+
|
49 |
|
49 |
|
50 |
/**
|
50 |
/**
|
51 |
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html.
|
51 |
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html.
|
52 |
*
|
52 |
*
|
53 |
* Cette fonction retourne un texte dans lequel touts les caractères correspondant
|
53 |
* Cette fonction retourne un texte dans lequel touts les caractères correspondant
|
54 |
* à des entités html sont remplacés par la valeur de l'entité, à l'exception
|
54 |
* à des entités html sont remplacés par la valeur de l'entité, à l'exception
|
55 |
* des caractères <, >, & et ".
|
55 |
* des caractères <, >, & et ".
|
56 |
* Cela permet de remplacer toutes les entités dans une chaine contenant du html.
|
56 |
* Cela permet de remplacer toutes les entités dans une chaine contenant du html.
|
57 |
*
|
57 |
*
|
58 |
*@param string la chaîne html à parsser.
|
58 |
*@param string la chaîne html à parsser.
|
59 |
*@return string contient la chaîne html avec les entités intégrées.
|
59 |
*@return string contient la chaîne html avec les entités intégrées.
|
60 |
*/
|
60 |
*/
|
61 |
|
61 |
|
62 |
function remplaceEntiteHTLM($texte)
|
62 |
function remplaceEntiteHTLM($texte)
|
63 |
{
|
63 |
{
|
64 |
$texte_retour = '';
|
64 |
$texte_retour = '';
|
65 |
$tab_entites = get_html_translation_table(HTML_ENTITIES);
|
65 |
$tab_entites = get_html_translation_table(HTML_ENTITIES);
|
66 |
unset($tab_entites['"']);
|
66 |
unset($tab_entites['"']);
|
67 |
unset($tab_entites['<']);
|
67 |
unset($tab_entites['<']);
|
68 |
unset($tab_entites['>']);
|
68 |
unset($tab_entites['>']);
|
69 |
unset($tab_entites['&']);
|
69 |
unset($tab_entites['&']);
|
- |
|
70 |
$tab_entites[' & '] = ' & ';
|
70 |
return strtr($texte, $tab_entites);
|
71 |
return strtr($texte, $tab_entites);
|
71 |
}
|
72 |
}
|
72 |
|
73 |
|
73 |
// +------------------------------------------------------------------------------------------------------+
|
74 |
// +------------------------------------------------------------------------------------------------------+
|
74 |
// | PIED du PROGRAMME |
|
75 |
// | PIED du PROGRAMME |
|
75 |
// +------------------------------------------------------------------------------------------------------+
|
76 |
// +------------------------------------------------------------------------------------------------------+
|
76 |
|
77 |
|
77 |
|
78 |
|
78 |
|
79 |
|
79 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
80 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
80 |
*
|
81 |
*
|
81 |
* $Log: not supported by cvs2svn $
|
82 |
* $Log: not supported by cvs2svn $
|
- |
|
83 |
* Revision 1.1 2005/01/18 12:14:24 jpm
|
- |
|
84 |
* Ajout d'un fichier contenant une fonction permettant d'attribuer des entités html à la place des caractères non impliqués dans le HTML.
|
- |
|
85 |
*
|
82 |
*
|
86 |
*
|
83 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
87 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
84 |
*/
|
88 |
*/
|
85 |
?>
|
89 |
?>
|