1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
| | !// Escapes
!class Link_escape extends Link
{
var $pattern;
var $plain,$param;
function Link_escape($start)
{
parent::Link($start);
}
function get_pattern()
{
$this->pattern = <<<EOD
&
( # (1) plain
- (\w+) # (2) plugin name
- (?:
- \(
- ((?:(?!\)[;{]).)*) # (3) parameter
- \)
- )?
+ ([-!"#$%&'()=~|\\`@+*;:<>?_,.\/}{\][ ^]) # (2) plugin name
)
EOD;
return <<<EOD
{$this->pattern}
-(?:
- \{
- ((?:(?R)|(?!};).)*) # (4) body
- \}
-)?
;
EOD;
}
function get_count()
{
- return 4;
+ return 2;
}
function set($arr, $page)
{
- list($all, $this->plain, $name, $this->param, $body) = $this->splice($arr);
+ list($all, $this->plain, $name) = $this->splice($arr);
// Re-get true plugin name and patameters (for PHP 4.1.2)
$matches = array();
if (preg_match('/^' . $this->pattern . '/x', $all, $matches)
&& $matches[1] != $this->plain)
list(, $this->plain, $name) = $matches;
+ $body = '';
- return parent::setParam($page, $name, $body, 'plugin');
+ return parent::setParam($page, $name, $body, 'escape');
}
function toString()
{
! return htmlspecialchars($this->name);
}
}
|