Rev | Line | |
---|
[14392] | 1 | <?php
|
---|
| 2 | /**
|
---|
[14527] | 3 | * Script¥¿¥°¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë
|
---|
[14392] | 4 | *
|
---|
[14527] | 5 | * @param string $value ÆþÎÏ
|
---|
| 6 | * @return string $value ¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¤ÏÊÑ´¹¸å¤Îʸ»úÎ󡢤·¤Ê¤¤¾ì¹ç¤ÏÆþÎϤµ¤ì¤¿Ê¸»úÎó¤ò¤½¤Î¤Þ¤ÞÊÖ¤¹¡£
|
---|
[14392] | 7 | */
|
---|
| 8 | function smarty_modifier_script_escape($value) {
|
---|
| 9 |
|
---|
[15056] | 10 | if (is_array($value)) return $value;
|
---|
[14465] | 11 |
|
---|
[15056] | 12 | $pattern = "/<script.*?>|<\/script>|javascript:/";
|
---|
[14676] | 13 | $convert = "#script tag escaped#";
|
---|
[14527] | 14 |
|
---|
[14530] | 15 | if ( preg_match_all($pattern, $value, $matches) ) {
|
---|
[14527] | 16 | return preg_replace($pattern, $convert, $value);
|
---|
| 17 | } else {
|
---|
| 18 | return $value;
|
---|
| 19 | }
|
---|
[14392] | 20 | }
|
---|
| 21 | ?>
|
---|
Note: See
TracBrowser
for help on using the repository browser.