@@ -13,44 +13,44 @@ |
||
| 13 | 13 | |
| 14 | 14 | class InterdireScriptLaxisteTest extends TestCase |
| 15 | 15 | { |
| 16 | - protected static $save_filtrer_javascript; |
|
| 17 | - |
|
| 18 | - public static function setUpBeforeClass(): void { |
|
| 19 | - self::$save_filtrer_javascript = $GLOBALS['filtrer_javascript']; |
|
| 20 | - find_in_path('inc/texte.php', '', true); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public static function tearDownAfterClass(): void { |
|
| 24 | - $GLOBALS['filtrer_javascript'] = self::$save_filtrer_javascript; |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - protected function setUp(): void { |
|
| 28 | - $GLOBALS['filtrer_javascript'] = 1; |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - #[DataProvider('providerTexteInterdireScriptLaxiste')] |
|
| 32 | - public function testTexteInterdireScriptLaxiste($expected, ...$args): void { |
|
| 33 | - $actual = interdire_scripts(...$args); |
|
| 34 | - $this->assertSame($expected, $actual); |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public static function providerTexteInterdireScriptLaxiste(): array { |
|
| 38 | - return [ |
|
| 39 | - [ |
|
| 40 | - "<script type='text/javascript' src='toto.js'></script>", "<script type='text/javascript' src='toto.js'></script>", |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 44 | - "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 45 | - ], |
|
| 46 | - ["<script type='text/javascript'>var php=5;</script>", "<script type='text/javascript'>var php=5;</script>"], |
|
| 47 | - [ |
|
| 48 | - "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 49 | - "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 50 | - ], |
|
| 51 | - ["<script language='php'>die();</script>", "<script language='php'>die();</script>"], |
|
| 52 | - ['<script language=php>die();</script>', '<script language=php>die();</script>'], |
|
| 53 | - ['<script language = php >die();</script>', '<script language = php >die();</script>'], |
|
| 54 | - ]; |
|
| 55 | - } |
|
| 16 | + protected static $save_filtrer_javascript; |
|
| 17 | + |
|
| 18 | + public static function setUpBeforeClass(): void { |
|
| 19 | + self::$save_filtrer_javascript = $GLOBALS['filtrer_javascript']; |
|
| 20 | + find_in_path('inc/texte.php', '', true); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public static function tearDownAfterClass(): void { |
|
| 24 | + $GLOBALS['filtrer_javascript'] = self::$save_filtrer_javascript; |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + protected function setUp(): void { |
|
| 28 | + $GLOBALS['filtrer_javascript'] = 1; |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + #[DataProvider('providerTexteInterdireScriptLaxiste')] |
|
| 32 | + public function testTexteInterdireScriptLaxiste($expected, ...$args): void { |
|
| 33 | + $actual = interdire_scripts(...$args); |
|
| 34 | + $this->assertSame($expected, $actual); |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public static function providerTexteInterdireScriptLaxiste(): array { |
|
| 38 | + return [ |
|
| 39 | + [ |
|
| 40 | + "<script type='text/javascript' src='toto.js'></script>", "<script type='text/javascript' src='toto.js'></script>", |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 44 | + "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 45 | + ], |
|
| 46 | + ["<script type='text/javascript'>var php=5;</script>", "<script type='text/javascript'>var php=5;</script>"], |
|
| 47 | + [ |
|
| 48 | + "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 49 | + "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 50 | + ], |
|
| 51 | + ["<script language='php'>die();</script>", "<script language='php'>die();</script>"], |
|
| 52 | + ['<script language=php>die();</script>', '<script language=php>die();</script>'], |
|
| 53 | + ['<script language = php >die();</script>', '<script language = php >die();</script>'], |
|
| 54 | + ]; |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -13,79 +13,79 @@ |
||
| 13 | 13 | |
| 14 | 14 | class PropreTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('inc/texte.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('inc/texte.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - protected function setUp(): void { |
|
| 21 | - $GLOBALS['meta']['type_urls'] = 'page'; |
|
| 22 | - $GLOBALS['type_urls'] = 'page'; |
|
| 23 | - changer_langue('fr'); |
|
| 24 | - // ce test est en fr |
|
| 25 | - $GLOBALS['toujours_paragrapher'] = true; |
|
| 26 | - foreach (['puce', 'puce_rtl', 'puce_prive', 'puce_prive_rtl'] as $puce) { |
|
| 27 | - unset($GLOBALS[$puce]); |
|
| 28 | - } |
|
| 29 | - definir_puce(); |
|
| 30 | - // initialiser les plugins qui changent les intertitre (Z), et les restaurer juste apres |
|
| 31 | - $mem = [$GLOBALS['debut_intertitre'] ?? null, $GLOBALS['spip_raccourcis_typo'] ?? null]; |
|
| 32 | - propre('rien du tout'); |
|
| 33 | - [$GLOBALS['debut_intertitre'], $GLOBALS['spip_raccourcis_typo']] = $mem; |
|
| 34 | - } |
|
| 20 | + protected function setUp(): void { |
|
| 21 | + $GLOBALS['meta']['type_urls'] = 'page'; |
|
| 22 | + $GLOBALS['type_urls'] = 'page'; |
|
| 23 | + changer_langue('fr'); |
|
| 24 | + // ce test est en fr |
|
| 25 | + $GLOBALS['toujours_paragrapher'] = true; |
|
| 26 | + foreach (['puce', 'puce_rtl', 'puce_prive', 'puce_prive_rtl'] as $puce) { |
|
| 27 | + unset($GLOBALS[$puce]); |
|
| 28 | + } |
|
| 29 | + definir_puce(); |
|
| 30 | + // initialiser les plugins qui changent les intertitre (Z), et les restaurer juste apres |
|
| 31 | + $mem = [$GLOBALS['debut_intertitre'] ?? null, $GLOBALS['spip_raccourcis_typo'] ?? null]; |
|
| 32 | + propre('rien du tout'); |
|
| 33 | + [$GLOBALS['debut_intertitre'], $GLOBALS['spip_raccourcis_typo']] = $mem; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - #[DataProvider('providerTextePropre')] |
|
| 37 | - public function testTextePropre($expected, ...$args): void { |
|
| 38 | - $actual = propre(...$args); |
|
| 39 | - $this->assertSame($expected, $actual); |
|
| 40 | - } |
|
| 36 | + #[DataProvider('providerTextePropre')] |
|
| 37 | + public function testTextePropre($expected, ...$args): void { |
|
| 38 | + $actual = propre(...$args); |
|
| 39 | + $this->assertSame($expected, $actual); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public static function providerTextePropre(): array { |
|
| 43 | - return [ |
|
| 44 | - 'vide' => [ |
|
| 45 | - 0 => '', |
|
| 46 | - 1 => '', |
|
| 47 | - ], |
|
| 48 | - 'null' => [ |
|
| 49 | - 0 => '', |
|
| 50 | - 1 => null, |
|
| 51 | - ], |
|
| 52 | - 'array' => [ |
|
| 53 | - 0 => '', |
|
| 54 | - 1 => [], |
|
| 55 | - ], |
|
| 56 | - 'chaine_zero' => [ |
|
| 57 | - 0 => '<p>0</p>', |
|
| 58 | - 1 => '0', |
|
| 59 | - ], |
|
| 60 | - 'nombre_zero' => [ |
|
| 61 | - 0 => '<p>0</p>', |
|
| 62 | - 1 => 0, |
|
| 63 | - ], |
|
| 64 | - 'string_1' => [ |
|
| 65 | - 0 => '<p>Un texte avec des <a href="http://spip.net">liens</a> <a href="spip.php?article1" class="spip_in">Article 1</a> <a href="http://www.spip.net" class="spip_out" rel="external">spip</a> <a href="http://www.spip.net" class="spip_url spip_out auto" rel="nofollow external">http://www.spip.net</a></p>', |
|
| 66 | - 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 67 | - ], |
|
| 68 | - 'string_2' => [ |
|
| 69 | - 0 => '<p>Un texte avec des entités &<>"</p>', |
|
| 70 | - 1 => 'Un texte avec des entités &<>"', |
|
| 71 | - ], |
|
| 72 | - 'string_3' => [ |
|
| 73 | - 0 => '<p>Un texte sans entites &<>"’</p>', |
|
| 74 | - 1 => 'Un texte sans entites &<>"\'', |
|
| 75 | - ], |
|
| 76 | - 'string_4' => [ |
|
| 77 | - 0 => '<h2 class="spip">Des raccourcis</h2> |
|
| 42 | + public static function providerTextePropre(): array { |
|
| 43 | + return [ |
|
| 44 | + 'vide' => [ |
|
| 45 | + 0 => '', |
|
| 46 | + 1 => '', |
|
| 47 | + ], |
|
| 48 | + 'null' => [ |
|
| 49 | + 0 => '', |
|
| 50 | + 1 => null, |
|
| 51 | + ], |
|
| 52 | + 'array' => [ |
|
| 53 | + 0 => '', |
|
| 54 | + 1 => [], |
|
| 55 | + ], |
|
| 56 | + 'chaine_zero' => [ |
|
| 57 | + 0 => '<p>0</p>', |
|
| 58 | + 1 => '0', |
|
| 59 | + ], |
|
| 60 | + 'nombre_zero' => [ |
|
| 61 | + 0 => '<p>0</p>', |
|
| 62 | + 1 => 0, |
|
| 63 | + ], |
|
| 64 | + 'string_1' => [ |
|
| 65 | + 0 => '<p>Un texte avec des <a href="http://spip.net">liens</a> <a href="spip.php?article1" class="spip_in">Article 1</a> <a href="http://www.spip.net" class="spip_out" rel="external">spip</a> <a href="http://www.spip.net" class="spip_url spip_out auto" rel="nofollow external">http://www.spip.net</a></p>', |
|
| 66 | + 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 67 | + ], |
|
| 68 | + 'string_2' => [ |
|
| 69 | + 0 => '<p>Un texte avec des entités &<>"</p>', |
|
| 70 | + 1 => 'Un texte avec des entités &<>"', |
|
| 71 | + ], |
|
| 72 | + 'string_3' => [ |
|
| 73 | + 0 => '<p>Un texte sans entites &<>"’</p>', |
|
| 74 | + 1 => 'Un texte sans entites &<>"\'', |
|
| 75 | + ], |
|
| 76 | + 'string_4' => [ |
|
| 77 | + 0 => '<h2 class="spip">Des raccourcis</h2> |
|
| 78 | 78 | <p> <i>italique</i> <strong>gras</strong> <code class="spip_code spip_code_inline" dir="ltr">du code</code></p>', |
| 79 | - 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 80 | - ], |
|
| 81 | - 'string_5' => [ |
|
| 82 | - 0 => '<p>Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt></p>', |
|
| 83 | - 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 84 | - ], |
|
| 85 | - 'string_6' => [ |
|
| 86 | - 0 => '<p><span class="spip-puce ltr"><b>–</b></span> propre</p>', |
|
| 87 | - 1 => '- propre', |
|
| 88 | - ], |
|
| 89 | - ]; |
|
| 90 | - } |
|
| 79 | + 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 80 | + ], |
|
| 81 | + 'string_5' => [ |
|
| 82 | + 0 => '<p>Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt></p>', |
|
| 83 | + 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 84 | + ], |
|
| 85 | + 'string_6' => [ |
|
| 86 | + 0 => '<p><span class="spip-puce ltr"><b>–</b></span> propre</p>', |
|
| 87 | + 1 => '- propre', |
|
| 88 | + ], |
|
| 89 | + ]; |
|
| 90 | + } |
|
| 91 | 91 | } |
@@ -13,53 +13,53 @@ |
||
| 13 | 13 | |
| 14 | 14 | class EchapperHtmlSuspectTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static $filtrer_javascript; |
|
| 16 | + public static $filtrer_javascript; |
|
| 17 | 17 | |
| 18 | - public static $lang; |
|
| 18 | + public static $lang; |
|
| 19 | 19 | |
| 20 | - public static function setUpBeforeClass(): void { |
|
| 21 | - find_in_path('inc/texte.php', '', true); |
|
| 22 | - static::$filtrer_javascript = $GLOBALS['filtrer_javascript'] ?? null; |
|
| 23 | - $GLOBALS['filtrer_javascript'] = -1; |
|
| 24 | - // ce test est en en |
|
| 25 | - static::$lang = $GLOBALS['spip_lang']; |
|
| 26 | - changer_langue('en'); |
|
| 27 | - } |
|
| 20 | + public static function setUpBeforeClass(): void { |
|
| 21 | + find_in_path('inc/texte.php', '', true); |
|
| 22 | + static::$filtrer_javascript = $GLOBALS['filtrer_javascript'] ?? null; |
|
| 23 | + $GLOBALS['filtrer_javascript'] = -1; |
|
| 24 | + // ce test est en en |
|
| 25 | + static::$lang = $GLOBALS['spip_lang']; |
|
| 26 | + changer_langue('en'); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public static function tearDownAfterClass(): void { |
|
| 30 | - $GLOBALS['filtrer_javascript'] = static::$filtrer_javascript; |
|
| 31 | - $GLOBALS['spip_lang'] = static::$lang; |
|
| 32 | - } |
|
| 29 | + public static function tearDownAfterClass(): void { |
|
| 30 | + $GLOBALS['filtrer_javascript'] = static::$filtrer_javascript; |
|
| 31 | + $GLOBALS['spip_lang'] = static::$lang; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - #[DataProvider('providerIsHtmlSafe')] |
|
| 35 | - public function testIsHtmlSafe($expected, ...$args): void { |
|
| 36 | - $actual = is_html_safe(...$args); |
|
| 37 | - $this->assertSame($expected, $actual); |
|
| 38 | - } |
|
| 34 | + #[DataProvider('providerIsHtmlSafe')] |
|
| 35 | + public function testIsHtmlSafe($expected, ...$args): void { |
|
| 36 | + $actual = is_html_safe(...$args); |
|
| 37 | + $this->assertSame($expected, $actual); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public static function providerIsHtmlSafe(): array { |
|
| 41 | - return [ |
|
| 42 | - 'relOK' => [ |
|
| 43 | - true, |
|
| 44 | - 'Voir aussi la page du taxon ️<a class="nom_scientifique" href="http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=183813" rel="noreferrer">Acinonyx jubatus</a>. Wikipedia (descriptif rapide).', |
|
| 45 | - ], |
|
| 46 | - 'relInconnu' => [ |
|
| 47 | - false, |
|
| 48 | - 'Voir aussi la page du taxon ️<a class="nom_scientifique" href="http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=183813" rel="relinconnu">Acinonyx jubatus</a>. Wikipedia (descriptif rapide).', |
|
| 49 | - ], |
|
| 50 | - 'span_lang_fr' => [true, '<span lang="fr">Créer des sélections d’objets ayant un prix</span>'], |
|
| 51 | - 'span_lang_fr_simples_quotes' => [ |
|
| 52 | - true, |
|
| 53 | - '<span lang=\'fr\'>Créer des sélections d’objets ayant un prix</span>', |
|
| 54 | - ], |
|
| 55 | - 'entite_unicode' => [true, '<span lang=\'fr\'>Créer des sélections d’objets ayant un prix</span>'], |
|
| 56 | - 'multi_safe' => [true, '<multi>[fr]Salut[en]Hey[de]Hallo</multi>'], |
|
| 57 | - 'multi_malicious' => [false, '<multi><script type="text/javascript">alert()</script></multi>'], |
|
| 58 | - 'idiome' => [true, '<:spip:bonjour:> Toto'], |
|
| 59 | - 'mdash' => [ |
|
| 60 | - true, |
|
| 61 | - "Experimenter en astronomie — Collaboration amateur<span aria-hidden='true'>·</span>trices-professionnel<span aria-hidden='true'>·</span>les", |
|
| 62 | - ], |
|
| 63 | - ]; |
|
| 64 | - } |
|
| 40 | + public static function providerIsHtmlSafe(): array { |
|
| 41 | + return [ |
|
| 42 | + 'relOK' => [ |
|
| 43 | + true, |
|
| 44 | + 'Voir aussi la page du taxon ️<a class="nom_scientifique" href="http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=183813" rel="noreferrer">Acinonyx jubatus</a>. Wikipedia (descriptif rapide).', |
|
| 45 | + ], |
|
| 46 | + 'relInconnu' => [ |
|
| 47 | + false, |
|
| 48 | + 'Voir aussi la page du taxon ️<a class="nom_scientifique" href="http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=183813" rel="relinconnu">Acinonyx jubatus</a>. Wikipedia (descriptif rapide).', |
|
| 49 | + ], |
|
| 50 | + 'span_lang_fr' => [true, '<span lang="fr">Créer des sélections d’objets ayant un prix</span>'], |
|
| 51 | + 'span_lang_fr_simples_quotes' => [ |
|
| 52 | + true, |
|
| 53 | + '<span lang=\'fr\'>Créer des sélections d’objets ayant un prix</span>', |
|
| 54 | + ], |
|
| 55 | + 'entite_unicode' => [true, '<span lang=\'fr\'>Créer des sélections d’objets ayant un prix</span>'], |
|
| 56 | + 'multi_safe' => [true, '<multi>[fr]Salut[en]Hey[de]Hallo</multi>'], |
|
| 57 | + 'multi_malicious' => [false, '<multi><script type="text/javascript">alert()</script></multi>'], |
|
| 58 | + 'idiome' => [true, '<:spip:bonjour:> Toto'], |
|
| 59 | + 'mdash' => [ |
|
| 60 | + true, |
|
| 61 | + "Experimenter en astronomie — Collaboration amateur<span aria-hidden='true'>·</span>trices-professionnel<span aria-hidden='true'>·</span>les", |
|
| 62 | + ], |
|
| 63 | + ]; |
|
| 64 | + } |
|
| 65 | 65 | } |
@@ -13,47 +13,47 @@ |
||
| 13 | 13 | |
| 14 | 14 | class InterdireScriptParanoTest extends TestCase |
| 15 | 15 | { |
| 16 | - protected static $save_filtrer_javascript; |
|
| 17 | - |
|
| 18 | - public static function setUpBeforeClass(): void { |
|
| 19 | - self::$save_filtrer_javascript = $GLOBALS['filtrer_javascript']; |
|
| 20 | - find_in_path('inc/texte.php', '', true); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public static function tearDownAfterClass(): void { |
|
| 24 | - $GLOBALS['filtrer_javascript'] = self::$save_filtrer_javascript; |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - protected function setUp(): void { |
|
| 28 | - $GLOBALS['filtrer_javascript'] = -1; |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - #[DataProvider('providerTexteInterdireScriptParano')] |
|
| 32 | - public function testTexteInterdireScriptParano($expected, ...$args): void { |
|
| 33 | - $actual = interdire_scripts(...$args); |
|
| 34 | - $this->assertSame($expected, $actual); |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public static function providerTexteInterdireScriptParano(): array { |
|
| 38 | - return [ |
|
| 39 | - [ |
|
| 40 | - "<code class=\"echappe-js\"><script type='text/javascript' src='toto.js'></script></code>", "<script type='text/javascript' src='toto.js'></script>", |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - "<code class=\"echappe-js\"><script type='text/javascript' src='spip.php?page=toto'></script></code>", |
|
| 44 | - "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 45 | - ], |
|
| 46 | - [ |
|
| 47 | - "<code class=\"echappe-js\"><script type='text/javascript'>var php=5;</script></code>", |
|
| 48 | - "<script type='text/javascript'>var php=5;</script>", |
|
| 49 | - ], |
|
| 50 | - [ |
|
| 51 | - "<code class=\"echappe-js\"><script language='javascript' src='spip.php?page=toto'></script></code>", |
|
| 52 | - "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 53 | - ], |
|
| 54 | - ["<script language='php'>die();</script>", "<script language='php'>die();</script>"], |
|
| 55 | - ['<script language=php>die();</script>', '<script language=php>die();</script>'], |
|
| 56 | - ['<script language = php >die();</script>', '<script language = php >die();</script>'], |
|
| 57 | - ]; |
|
| 58 | - } |
|
| 16 | + protected static $save_filtrer_javascript; |
|
| 17 | + |
|
| 18 | + public static function setUpBeforeClass(): void { |
|
| 19 | + self::$save_filtrer_javascript = $GLOBALS['filtrer_javascript']; |
|
| 20 | + find_in_path('inc/texte.php', '', true); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public static function tearDownAfterClass(): void { |
|
| 24 | + $GLOBALS['filtrer_javascript'] = self::$save_filtrer_javascript; |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + protected function setUp(): void { |
|
| 28 | + $GLOBALS['filtrer_javascript'] = -1; |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + #[DataProvider('providerTexteInterdireScriptParano')] |
|
| 32 | + public function testTexteInterdireScriptParano($expected, ...$args): void { |
|
| 33 | + $actual = interdire_scripts(...$args); |
|
| 34 | + $this->assertSame($expected, $actual); |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public static function providerTexteInterdireScriptParano(): array { |
|
| 38 | + return [ |
|
| 39 | + [ |
|
| 40 | + "<code class=\"echappe-js\"><script type='text/javascript' src='toto.js'></script></code>", "<script type='text/javascript' src='toto.js'></script>", |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + "<code class=\"echappe-js\"><script type='text/javascript' src='spip.php?page=toto'></script></code>", |
|
| 44 | + "<script type='text/javascript' src='spip.php?page=toto'></script>", |
|
| 45 | + ], |
|
| 46 | + [ |
|
| 47 | + "<code class=\"echappe-js\"><script type='text/javascript'>var php=5;</script></code>", |
|
| 48 | + "<script type='text/javascript'>var php=5;</script>", |
|
| 49 | + ], |
|
| 50 | + [ |
|
| 51 | + "<code class=\"echappe-js\"><script language='javascript' src='spip.php?page=toto'></script></code>", |
|
| 52 | + "<script language='javascript' src='spip.php?page=toto'></script>", |
|
| 53 | + ], |
|
| 54 | + ["<script language='php'>die();</script>", "<script language='php'>die();</script>"], |
|
| 55 | + ['<script language=php>die();</script>', '<script language=php>die();</script>'], |
|
| 56 | + ['<script language = php >die();</script>', '<script language = php >die();</script>'], |
|
| 57 | + ]; |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -13,125 +13,125 @@ |
||
| 13 | 13 | |
| 14 | 14 | class TypoTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('inc/texte.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('inc/texte.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - protected function setUp(): void { |
|
| 21 | - $GLOBALS['meta']['type_urls'] = 'page'; |
|
| 22 | - $GLOBALS['type_urls'] = 'page'; |
|
| 23 | - // ce test est en fr |
|
| 24 | - changer_langue('fr'); |
|
| 25 | - } |
|
| 20 | + protected function setUp(): void { |
|
| 21 | + $GLOBALS['meta']['type_urls'] = 'page'; |
|
| 22 | + $GLOBALS['type_urls'] = 'page'; |
|
| 23 | + // ce test est en fr |
|
| 24 | + changer_langue('fr'); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - #[DataProvider('providerTexteTypo')] |
|
| 28 | - public function testTexteTypo($expected, ...$args): void { |
|
| 29 | - $actual = typo(...$args); |
|
| 30 | - $this->assertSame($expected, $actual); |
|
| 31 | - } |
|
| 27 | + #[DataProvider('providerTexteTypo')] |
|
| 28 | + public function testTexteTypo($expected, ...$args): void { |
|
| 29 | + $actual = typo(...$args); |
|
| 30 | + $this->assertSame($expected, $actual); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - public static function providerTexteTypo(): array { |
|
| 34 | - return [ |
|
| 35 | - 0 => |
|
| 36 | - [ |
|
| 37 | - 0 => 'Quelle question !', |
|
| 38 | - 1 => 'Quelle question!', |
|
| 39 | - ], |
|
| 40 | - 1 => |
|
| 41 | - [ |
|
| 42 | - 0 => '', |
|
| 43 | - 1 => '', |
|
| 44 | - 2 => true, |
|
| 45 | - ], |
|
| 46 | - 2 => |
|
| 47 | - [ |
|
| 48 | - 0 => '', |
|
| 49 | - 1 => '', |
|
| 50 | - 2 => false, |
|
| 51 | - ], |
|
| 52 | - 3 => |
|
| 53 | - [ |
|
| 54 | - 0 => '0', |
|
| 55 | - 1 => '0', |
|
| 56 | - 2 => true, |
|
| 57 | - ], |
|
| 58 | - 4 => |
|
| 59 | - [ |
|
| 60 | - 0 => '0', |
|
| 61 | - 1 => '0', |
|
| 62 | - 2 => false, |
|
| 63 | - ], |
|
| 64 | - 5 => |
|
| 65 | - [ |
|
| 66 | - 0 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 67 | - 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 68 | - 2 => true, |
|
| 69 | - ], |
|
| 70 | - 6 => |
|
| 71 | - [ |
|
| 72 | - 0 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 73 | - 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 74 | - 2 => false, |
|
| 75 | - ], |
|
| 76 | - 7 => |
|
| 77 | - [ |
|
| 78 | - 0 => 'Un texte avec des entités &<>"', |
|
| 79 | - 1 => 'Un texte avec des entités &<>"', |
|
| 80 | - 2 => true, |
|
| 81 | - ], |
|
| 82 | - 8 => |
|
| 83 | - [ |
|
| 84 | - 0 => 'Un texte avec des entités &<>"', |
|
| 85 | - 1 => 'Un texte avec des entités &<>"', |
|
| 86 | - 2 => false, |
|
| 87 | - ], |
|
| 88 | - 9 => |
|
| 89 | - [ |
|
| 90 | - 0 => 'Un texte sans entites &<>"’', |
|
| 91 | - 1 => 'Un texte sans entites &<>"\'', |
|
| 92 | - 2 => true, |
|
| 93 | - ], |
|
| 94 | - 10 => |
|
| 95 | - [ |
|
| 96 | - 0 => 'Un texte sans entites &<>"’', |
|
| 97 | - 1 => 'Un texte sans entites &<>"\'', |
|
| 98 | - 2 => false, |
|
| 99 | - ], |
|
| 100 | - 11 => |
|
| 101 | - [ |
|
| 102 | - 0 => '{{{Des raccourcis}}} {italique} {{gras}} <code class="spip_code spip_code_inline" dir="ltr">du code</code>', |
|
| 103 | - 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 104 | - 2 => true, |
|
| 105 | - ], |
|
| 106 | - 12 => |
|
| 107 | - [ |
|
| 108 | - 0 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 109 | - 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 110 | - 2 => false, |
|
| 111 | - ], |
|
| 112 | - 13 => |
|
| 113 | - [ |
|
| 114 | - 0 => 'Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt>', |
|
| 115 | - 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 116 | - 2 => true, |
|
| 117 | - ], |
|
| 118 | - 14 => |
|
| 119 | - [ |
|
| 120 | - 0 => 'Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt>', |
|
| 121 | - 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 122 | - 2 => false, |
|
| 123 | - ], |
|
| 124 | - 15 => |
|
| 125 | - [ |
|
| 126 | - 0 => 'Chat !!', |
|
| 127 | - 1 => 'Chat!!', |
|
| 128 | - ], |
|
| 129 | - // et pas apres "(" -- http://trac.rezo.net/trac/spip/changeset/10177 |
|
| 130 | - 'r10177' => |
|
| 131 | - [ |
|
| 132 | - 0 => '(!)', |
|
| 133 | - 1 => '(!)', |
|
| 134 | - ], |
|
| 135 | - ]; |
|
| 136 | - } |
|
| 33 | + public static function providerTexteTypo(): array { |
|
| 34 | + return [ |
|
| 35 | + 0 => |
|
| 36 | + [ |
|
| 37 | + 0 => 'Quelle question !', |
|
| 38 | + 1 => 'Quelle question!', |
|
| 39 | + ], |
|
| 40 | + 1 => |
|
| 41 | + [ |
|
| 42 | + 0 => '', |
|
| 43 | + 1 => '', |
|
| 44 | + 2 => true, |
|
| 45 | + ], |
|
| 46 | + 2 => |
|
| 47 | + [ |
|
| 48 | + 0 => '', |
|
| 49 | + 1 => '', |
|
| 50 | + 2 => false, |
|
| 51 | + ], |
|
| 52 | + 3 => |
|
| 53 | + [ |
|
| 54 | + 0 => '0', |
|
| 55 | + 1 => '0', |
|
| 56 | + 2 => true, |
|
| 57 | + ], |
|
| 58 | + 4 => |
|
| 59 | + [ |
|
| 60 | + 0 => '0', |
|
| 61 | + 1 => '0', |
|
| 62 | + 2 => false, |
|
| 63 | + ], |
|
| 64 | + 5 => |
|
| 65 | + [ |
|
| 66 | + 0 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 67 | + 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 68 | + 2 => true, |
|
| 69 | + ], |
|
| 70 | + 6 => |
|
| 71 | + [ |
|
| 72 | + 0 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 73 | + 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 74 | + 2 => false, |
|
| 75 | + ], |
|
| 76 | + 7 => |
|
| 77 | + [ |
|
| 78 | + 0 => 'Un texte avec des entités &<>"', |
|
| 79 | + 1 => 'Un texte avec des entités &<>"', |
|
| 80 | + 2 => true, |
|
| 81 | + ], |
|
| 82 | + 8 => |
|
| 83 | + [ |
|
| 84 | + 0 => 'Un texte avec des entités &<>"', |
|
| 85 | + 1 => 'Un texte avec des entités &<>"', |
|
| 86 | + 2 => false, |
|
| 87 | + ], |
|
| 88 | + 9 => |
|
| 89 | + [ |
|
| 90 | + 0 => 'Un texte sans entites &<>"’', |
|
| 91 | + 1 => 'Un texte sans entites &<>"\'', |
|
| 92 | + 2 => true, |
|
| 93 | + ], |
|
| 94 | + 10 => |
|
| 95 | + [ |
|
| 96 | + 0 => 'Un texte sans entites &<>"’', |
|
| 97 | + 1 => 'Un texte sans entites &<>"\'', |
|
| 98 | + 2 => false, |
|
| 99 | + ], |
|
| 100 | + 11 => |
|
| 101 | + [ |
|
| 102 | + 0 => '{{{Des raccourcis}}} {italique} {{gras}} <code class="spip_code spip_code_inline" dir="ltr">du code</code>', |
|
| 103 | + 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 104 | + 2 => true, |
|
| 105 | + ], |
|
| 106 | + 12 => |
|
| 107 | + [ |
|
| 108 | + 0 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 109 | + 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 110 | + 2 => false, |
|
| 111 | + ], |
|
| 112 | + 13 => |
|
| 113 | + [ |
|
| 114 | + 0 => 'Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt>', |
|
| 115 | + 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 116 | + 2 => true, |
|
| 117 | + ], |
|
| 118 | + 14 => |
|
| 119 | + [ |
|
| 120 | + 0 => 'Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt>', |
|
| 121 | + 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 122 | + 2 => false, |
|
| 123 | + ], |
|
| 124 | + 15 => |
|
| 125 | + [ |
|
| 126 | + 0 => 'Chat !!', |
|
| 127 | + 1 => 'Chat!!', |
|
| 128 | + ], |
|
| 129 | + // et pas apres "(" -- http://trac.rezo.net/trac/spip/changeset/10177 |
|
| 130 | + 'r10177' => |
|
| 131 | + [ |
|
| 132 | + 0 => '(!)', |
|
| 133 | + 1 => '(!)', |
|
| 134 | + ], |
|
| 135 | + ]; |
|
| 136 | + } |
|
| 137 | 137 | } |
@@ -9,21 +9,21 @@ |
||
| 9 | 9 | |
| 10 | 10 | class FlockTest extends TestCase |
| 11 | 11 | { |
| 12 | - public static function setUpBeforeClass(): void { |
|
| 13 | - include_spip('inc/flock'); |
|
| 14 | - } |
|
| 12 | + public static function setUpBeforeClass(): void { |
|
| 13 | + include_spip('inc/flock'); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public function testSousRepertoire(): void { |
|
| 17 | - $sous_repertoire = 'test' . md5(strval(random_int(0, mt_getrandmax()))); |
|
| 18 | - $this->assertSame( |
|
| 19 | - sous_repertoire(_DIR_VAR, $sous_repertoire), |
|
| 20 | - _DIR_VAR . $sous_repertoire . '/' |
|
| 21 | - ); |
|
| 22 | - $this->assertTrue(file_exists(_DIR_VAR . $sous_repertoire)); |
|
| 23 | - $this->assertTrue(is_dir(_DIR_VAR . $sous_repertoire)); |
|
| 16 | + public function testSousRepertoire(): void { |
|
| 17 | + $sous_repertoire = 'test' . md5(strval(random_int(0, mt_getrandmax()))); |
|
| 18 | + $this->assertSame( |
|
| 19 | + sous_repertoire(_DIR_VAR, $sous_repertoire), |
|
| 20 | + _DIR_VAR . $sous_repertoire . '/' |
|
| 21 | + ); |
|
| 22 | + $this->assertTrue(file_exists(_DIR_VAR . $sous_repertoire)); |
|
| 23 | + $this->assertTrue(is_dir(_DIR_VAR . $sous_repertoire)); |
|
| 24 | 24 | |
| 25 | - // Nettoyage |
|
| 26 | - @unlink(_DIR_VAR . $sous_repertoire . '/.ok'); |
|
| 27 | - @rmdir(_DIR_VAR . $sous_repertoire); |
|
| 28 | - } |
|
| 25 | + // Nettoyage |
|
| 26 | + @unlink(_DIR_VAR . $sous_repertoire . '/.ok'); |
|
| 27 | + @rmdir(_DIR_VAR . $sous_repertoire); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -14,16 +14,16 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function testSousRepertoire(): void { |
| 17 | - $sous_repertoire = 'test' . md5(strval(random_int(0, mt_getrandmax()))); |
|
| 17 | + $sous_repertoire = 'test'.md5(strval(random_int(0, mt_getrandmax()))); |
|
| 18 | 18 | $this->assertSame( |
| 19 | 19 | sous_repertoire(_DIR_VAR, $sous_repertoire), |
| 20 | - _DIR_VAR . $sous_repertoire . '/' |
|
| 20 | + _DIR_VAR.$sous_repertoire.'/' |
|
| 21 | 21 | ); |
| 22 | - $this->assertTrue(file_exists(_DIR_VAR . $sous_repertoire)); |
|
| 23 | - $this->assertTrue(is_dir(_DIR_VAR . $sous_repertoire)); |
|
| 22 | + $this->assertTrue(file_exists(_DIR_VAR.$sous_repertoire)); |
|
| 23 | + $this->assertTrue(is_dir(_DIR_VAR.$sous_repertoire)); |
|
| 24 | 24 | |
| 25 | 25 | // Nettoyage |
| 26 | - @unlink(_DIR_VAR . $sous_repertoire . '/.ok'); |
|
| 27 | - @rmdir(_DIR_VAR . $sous_repertoire); |
|
| 26 | + @unlink(_DIR_VAR.$sous_repertoire.'/.ok'); |
|
| 27 | + @rmdir(_DIR_VAR.$sous_repertoire); |
|
| 28 | 28 | } |
| 29 | 29 | } |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class NfslockTest extends TestCase |
| 11 | 11 | { |
| 12 | - public static function setUpBeforeClass(): void { |
|
| 13 | - include_spip('inc/nfslock'); |
|
| 14 | - } |
|
| 12 | + public static function setUpBeforeClass(): void { |
|
| 13 | + include_spip('inc/nfslock'); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public function testNfslock(): void { |
|
| 17 | - $verrou = spip_nfslock('monfichier'); |
|
| 18 | - $this->assertNotFalse($verrou, 'Echec: pose du verrou'); |
|
| 16 | + public function testNfslock(): void { |
|
| 17 | + $verrou = spip_nfslock('monfichier'); |
|
| 18 | + $this->assertNotFalse($verrou, 'Echec: pose du verrou'); |
|
| 19 | 19 | |
| 20 | - $this->assertTrue(spip_nfslock_test('monfichier', $verrou), 'Échec: Ne valide pas le verrou posé sur le fichier'); |
|
| 21 | - $this->assertFalse(spip_nfslock_test('un autre', $verrou), 'Échec: valide le verrou sur un autre fichier'); |
|
| 22 | - $this->assertTrue(spip_nfsunlock('monfichier', $verrou), 'Échec: déverrouillage du verrou sur notre fichier'); |
|
| 20 | + $this->assertTrue(spip_nfslock_test('monfichier', $verrou), 'Échec: Ne valide pas le verrou posé sur le fichier'); |
|
| 21 | + $this->assertFalse(spip_nfslock_test('un autre', $verrou), 'Échec: valide le verrou sur un autre fichier'); |
|
| 22 | + $this->assertTrue(spip_nfsunlock('monfichier', $verrou), 'Échec: déverrouillage du verrou sur notre fichier'); |
|
| 23 | 23 | |
| 24 | - $this->assertFalse(spip_nfslock_test('monfichier', $verrou), 'Échec: verrou toujours présent sur notre fichier'); |
|
| 25 | - $this->assertFalse(spip_nfslock_test('monfichier', 0)); |
|
| 26 | - } |
|
| 24 | + $this->assertFalse(spip_nfslock_test('monfichier', $verrou), 'Échec: verrou toujours présent sur notre fichier'); |
|
| 25 | + $this->assertFalse(spip_nfslock_test('monfichier', 0)); |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -9,44 +9,44 @@ |
||
| 9 | 9 | |
| 10 | 10 | class CreerCheminTest extends TestCase |
| 11 | 11 | { |
| 12 | - private int $nb_dossiers_squelettes; |
|
| 13 | - |
|
| 14 | - public static function setUpBeforeClass(): void { |
|
| 15 | - include_spip('inc/utils'); |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function setUp(): void { |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public function testAddCheminSansDossierSquelettes() { |
|
| 22 | - $GLOBALS['dossier_squelettes'] = ''; |
|
| 23 | - $chemins = creer_chemin(); |
|
| 24 | - $this->assertIsArray($chemins); |
|
| 25 | - |
|
| 26 | - _chemin('toto'); |
|
| 27 | - $_chemins = creer_chemin(); |
|
| 28 | - |
|
| 29 | - $this->assertIsArray($_chemins); |
|
| 30 | - $this->assertEquals(count($chemins), count($_chemins) - 1, 'Erreur ajout chemin par la fonction _chemin() : mauvais compte'); |
|
| 31 | - if (is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 32 | - $this->assertEquals('toto/', $_chemins[1], 'Erreur ajout chemin par la fonction _chemin() : avec squelettes'); |
|
| 33 | - } else { |
|
| 34 | - $this->assertEquals('toto/', $_chemins[0], 'Erreur ajout chemin par la fonction _chemin() : sans squelettes'); |
|
| 35 | - } |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function testAddCheminAvecDossierSquelettes() { |
|
| 39 | - $GLOBALS['dossier_squelettes'] = 'titi:tutu'; |
|
| 40 | - $chemins = creer_chemin(); |
|
| 41 | - $this->assertIsArray($chemins); |
|
| 42 | - |
|
| 43 | - $squelettes = (int) is_dir(_DIR_RACINE . 'squelettes'); |
|
| 44 | - $dossier_squelettes = count(explode(':', $GLOBALS['dossier_squelettes'])); |
|
| 45 | - |
|
| 46 | - _chemin('toto'); |
|
| 47 | - $_chemins = creer_chemin(); |
|
| 48 | - |
|
| 49 | - $this->assertIsArray($_chemins); |
|
| 50 | - $this->assertEquals('toto/', $_chemins[$squelettes + $dossier_squelettes], 'Erreur ajout chemin par la fonction _chemin() : avec dossier_squelettes'); |
|
| 51 | - } |
|
| 12 | + private int $nb_dossiers_squelettes; |
|
| 13 | + |
|
| 14 | + public static function setUpBeforeClass(): void { |
|
| 15 | + include_spip('inc/utils'); |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function setUp(): void { |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public function testAddCheminSansDossierSquelettes() { |
|
| 22 | + $GLOBALS['dossier_squelettes'] = ''; |
|
| 23 | + $chemins = creer_chemin(); |
|
| 24 | + $this->assertIsArray($chemins); |
|
| 25 | + |
|
| 26 | + _chemin('toto'); |
|
| 27 | + $_chemins = creer_chemin(); |
|
| 28 | + |
|
| 29 | + $this->assertIsArray($_chemins); |
|
| 30 | + $this->assertEquals(count($chemins), count($_chemins) - 1, 'Erreur ajout chemin par la fonction _chemin() : mauvais compte'); |
|
| 31 | + if (is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 32 | + $this->assertEquals('toto/', $_chemins[1], 'Erreur ajout chemin par la fonction _chemin() : avec squelettes'); |
|
| 33 | + } else { |
|
| 34 | + $this->assertEquals('toto/', $_chemins[0], 'Erreur ajout chemin par la fonction _chemin() : sans squelettes'); |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function testAddCheminAvecDossierSquelettes() { |
|
| 39 | + $GLOBALS['dossier_squelettes'] = 'titi:tutu'; |
|
| 40 | + $chemins = creer_chemin(); |
|
| 41 | + $this->assertIsArray($chemins); |
|
| 42 | + |
|
| 43 | + $squelettes = (int) is_dir(_DIR_RACINE . 'squelettes'); |
|
| 44 | + $dossier_squelettes = count(explode(':', $GLOBALS['dossier_squelettes'])); |
|
| 45 | + |
|
| 46 | + _chemin('toto'); |
|
| 47 | + $_chemins = creer_chemin(); |
|
| 48 | + |
|
| 49 | + $this->assertIsArray($_chemins); |
|
| 50 | + $this->assertEquals('toto/', $_chemins[$squelettes + $dossier_squelettes], 'Erreur ajout chemin par la fonction _chemin() : avec dossier_squelettes'); |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $this->assertIsArray($_chemins); |
| 30 | 30 | $this->assertEquals(count($chemins), count($_chemins) - 1, 'Erreur ajout chemin par la fonction _chemin() : mauvais compte'); |
| 31 | - if (is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 31 | + if (is_dir(_DIR_RACINE.'squelettes')) { |
|
| 32 | 32 | $this->assertEquals('toto/', $_chemins[1], 'Erreur ajout chemin par la fonction _chemin() : avec squelettes'); |
| 33 | 33 | } else { |
| 34 | 34 | $this->assertEquals('toto/', $_chemins[0], 'Erreur ajout chemin par la fonction _chemin() : sans squelettes'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $chemins = creer_chemin(); |
| 41 | 41 | $this->assertIsArray($chemins); |
| 42 | 42 | |
| 43 | - $squelettes = (int) is_dir(_DIR_RACINE . 'squelettes'); |
|
| 43 | + $squelettes = (int) is_dir(_DIR_RACINE.'squelettes'); |
|
| 44 | 44 | $dossier_squelettes = count(explode(':', $GLOBALS['dossier_squelettes'])); |
| 45 | 45 | |
| 46 | 46 | _chemin('toto'); |
@@ -19,18 +19,18 @@ |
||
| 19 | 19 | $var_auth = $auth(); |
| 20 | 20 | |
| 21 | 21 | if ($var_auth !== '' && !is_int($var_auth)) { |
| 22 | - // si l'authentifie' n'a pas acces a l'espace de redac |
|
| 23 | - // c'est qu'on voulait forcer sa reconnaissance en tant que visiteur. |
|
| 24 | - // On reexecute pour deboucher sur le include public. |
|
| 25 | - // autrement on insiste |
|
| 26 | - if (is_array($var_auth)) { |
|
| 27 | - $var_auth = '../?' . $_SERVER['QUERY_STRING']; |
|
| 28 | - include_spip('inc/session'); |
|
| 29 | - // on prolonge le cookie |
|
| 30 | - set_cookie_session(null, time() + 3600 * 24 * 14); |
|
| 31 | - } |
|
| 32 | - include_spip('inc/headers'); |
|
| 33 | - redirige_formulaire($var_auth); |
|
| 22 | + // si l'authentifie' n'a pas acces a l'espace de redac |
|
| 23 | + // c'est qu'on voulait forcer sa reconnaissance en tant que visiteur. |
|
| 24 | + // On reexecute pour deboucher sur le include public. |
|
| 25 | + // autrement on insiste |
|
| 26 | + if (is_array($var_auth)) { |
|
| 27 | + $var_auth = '../?' . $_SERVER['QUERY_STRING']; |
|
| 28 | + include_spip('inc/session'); |
|
| 29 | + // on prolonge le cookie |
|
| 30 | + set_cookie_session(null, time() + 3600 * 24 * 14); |
|
| 31 | + } |
|
| 32 | + include_spip('inc/headers'); |
|
| 33 | + redirige_formulaire($var_auth); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // En somme, est prive' ce qui est publiquement nomme'... |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // Script pour appeler un squelette apres s'etre authentifie |
| 13 | 13 | |
| 14 | -include_once __DIR__ . '/inc_version.php'; |
|
| 14 | +include_once __DIR__.'/inc_version.php'; |
|
| 15 | 15 | |
| 16 | 16 | include_spip('inc/cookie'); |
| 17 | 17 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // On reexecute pour deboucher sur le include public. |
| 25 | 25 | // autrement on insiste |
| 26 | 26 | if (is_array($var_auth)) { |
| 27 | - $var_auth = '../?' . $_SERVER['QUERY_STRING']; |
|
| 27 | + $var_auth = '../?'.$_SERVER['QUERY_STRING']; |
|
| 28 | 28 | include_spip('inc/session'); |
| 29 | 29 | // on prolonge le cookie |
| 30 | 30 | set_cookie_session(null, time() + 3600 * 24 * 14); |
@@ -34,4 +34,4 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // En somme, est prive' ce qui est publiquement nomme'... |
| 37 | -include __DIR__ . '/public.php'; |
|
| 37 | +include __DIR__.'/public.php'; |
|