]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - tests/unit/pcre-crash.php
trailing_spaces
[SourceForge/phpwiki.git] / tests / unit / pcre-crash.php
1 <?php // $Id$
2         $blockpats=array();
3
4         $blockpats[] = '[ \t]+\S(?:.*\s*\n[ \t]+\S)*';
5         // Tables
6         $blockpats[] = '\|(?:.*\n\|)*';
7
8         // List items
9         $blockpats[] = '[#*;]*(?:[*#]|;.*?:)';
10
11         // Footnote definitions
12         $blockpats[] = '\[\s*(\d+)\s*\]';
13
14         if (0 and !$debug_skip) {
15         // Plugins
16         $blockpats[] = '<\?plugin(?:-form)?\b.*\?>\s*$';
17         }
18
19         // Section Title
20         $blockpats[] = '!{1,3}[^!]';
21
22         $block_re = ( '/\A((?:.|\n)*?)(^(?:'
23                       . join("|", $blockpats)
24                       . ').*$)\n?/m' );
25
26
27 $pat = "/\A(
28   (?:.|\n)*?)
29   (^ (?:[ \t]+\S
30        (?:.*\s*\n[ \t]+\S)* |
31        \|(?:.*\n\|)* | [#*;]*(?:[*#]|;.*?:) |
32        \[\s*(\d+)\s*\] |
33        <\?plugin(?:-form)?\b.*\?>\s*$ |
34        !{1,3}[^!])
35   .*$)\n?/Axm";
36
37 //     /\A((?:.|\n)*?)(^(?:[ \t]+\S(?:.*\s*\n[ \t]+\S)*|\|(?:.*\n\|)*|[#*;]*(?:[*#]|;.*?:)|\[\s*(\d+)\s*\]|!{1,3}[^!]).*$)\n?/m
38
39 // cli works fine, but sapi (Apache/2.0.48 or Apache 1) crashes.
40 $subj = str_repeat("123456789 ", 200);
41 preg_match($pat, $subj, $m);
42 //preg_match($block_re, $subj, $m);
43 echo "ok\n";
44
45 ?>