|
@@ 405-412 (lines=8) @@
|
| 402 |
|
// http://code.spip.net/@protege_js_modeles |
| 403 |
|
function protege_js_modeles($t) { |
| 404 |
|
if (isset($GLOBALS['visiteur_session'])) { |
| 405 |
|
if (preg_match_all(',<script.*?($|</script.),isS', $t, $r, PREG_SET_ORDER)) { |
| 406 |
|
if (!defined('_PROTEGE_JS_MODELES')) { |
| 407 |
|
include_spip('inc/acces'); |
| 408 |
|
define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 409 |
|
} |
| 410 |
|
foreach ($r as $regs) { |
| 411 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
| 412 |
|
} |
| 413 |
|
} |
| 414 |
|
if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
| 415 |
|
if (!defined('_PROTEGE_PHP_MODELES')) { |
|
@@ 414-421 (lines=8) @@
|
| 411 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
| 412 |
|
} |
| 413 |
|
} |
| 414 |
|
if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
| 415 |
|
if (!defined('_PROTEGE_PHP_MODELES')) { |
| 416 |
|
include_spip('inc/acces'); |
| 417 |
|
define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 418 |
|
} |
| 419 |
|
foreach ($r as $regs) { |
| 420 |
|
$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
| 421 |
|
} |
| 422 |
|
} |
| 423 |
|
} |
| 424 |
|
|