]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - tests/unit/pcre-crash.php
extra_empty_lines
[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 $pat = "/\A(
27   (?:.|\n)*?)
28   (^ (?:[ \t]+\S
29        (?:.*\s*\n[ \t]+\S)* |
30        \|(?:.*\n\|)* | [#*;]*(?:[*#]|;.*?:) |
31        \[\s*(\d+)\s*\] |
32        <\?plugin(?:-form)?\b.*\?>\s*$ |
33        !{1,3}[^!])
34   .*$)\n?/Axm";
35
36 //     /\A((?:.|\n)*?)(^(?:[ \t]+\S(?:.*\s*\n[ \t]+\S)*|\|(?:.*\n\|)*|[#*;]*(?:[*#]|;.*?:)|\[\s*(\d+)\s*\]|!{1,3}[^!]).*$)\n?/m
37
38 // cli works fine, but sapi (Apache/2.0.48 or Apache 1) crashes.
39 $subj = str_repeat("123456789 ", 200);
40 preg_match($pat, $subj, $m);
41 //preg_match($block_re, $subj, $m);
42 echo "ok\n";
43
44 ?>