|
@@ 426-433 (lines=8) @@
|
| 423 |
|
// https://code.spip.net/@protege_js_modeles |
| 424 |
|
function protege_js_modeles($t) { |
| 425 |
|
if (isset($GLOBALS['visiteur_session'])) { |
| 426 |
|
if (preg_match_all(',<script.*?($|</script.),isS', $t, $r, PREG_SET_ORDER)) { |
| 427 |
|
if (!defined('_PROTEGE_JS_MODELES')) { |
| 428 |
|
include_spip('inc/acces'); |
| 429 |
|
define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 430 |
|
} |
| 431 |
|
foreach ($r as $regs) { |
| 432 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
| 433 |
|
} |
| 434 |
|
} |
| 435 |
|
if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
| 436 |
|
if (!defined('_PROTEGE_PHP_MODELES')) { |
|
@@ 435-442 (lines=8) @@
|
| 432 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
| 433 |
|
} |
| 434 |
|
} |
| 435 |
|
if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
| 436 |
|
if (!defined('_PROTEGE_PHP_MODELES')) { |
| 437 |
|
include_spip('inc/acces'); |
| 438 |
|
define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 439 |
|
} |
| 440 |
|
foreach ($r as $regs) { |
| 441 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
| 442 |
|
} |
| 443 |
|
} |
| 444 |
|
} |
| 445 |
|
|