|
8 | 8 | $_patterns_c = $_replaces_c = array();
|
9 | 9 |
|
10 | 10 | // BB Code url
|
11 |
| -$_patterns_c[] = '/\[url=([\'"]?)((?:ht|f)tp[s]?:\/\/[!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/url\]/sUS'; |
| 11 | +$_patterns_c[] = '/\[url=([\'"]?)((?:ht|f)tp[s]?:\/\/[!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/url\]/sU'; |
12 | 12 | $_replaces_c[] = create_function('$m', 'return \'[[\'.str_replace(array("\r\n", "\r", "\n"), \'&br;\', $m[3]).\':\'.$m[2].\']]\';');
|
13 | 13 |
|
14 |
| -$_patterns_c[] = '/\[url=([\'"]?)([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/url\]/sUS'; |
| 14 | +$_patterns_c[] = '/\[url=([\'"]?)([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/url\]/sU'; |
15 | 15 | $_replaces_c[] = create_function('$m', 'return \'[[\'.str_replace(array("\r\n", "\r", "\n"), \'&br;\', $m[3]).\':http://\'.$m[2].\']]\';');
|
16 | 16 |
|
17 |
| -$_patterns_c[] = '/\[siteurl=([\'"]?)\/?([!~*\'();?:\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/siteurl\]/sUS'; |
| 17 | +$_patterns_c[] = '/\[siteurl=([\'"]?)\/?([!~*\'();?:\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\\1\](.+)\[\/siteurl\]/sU'; |
18 | 18 | $_replaces_c[] = create_function('$m', 'return \'[[\'.str_replace(array("\r\n", "\r", "\n"), \'&br;\', $m[3]).\':site://\'.$m[2].\']]\';');
|
19 | 19 |
|
20 | 20 | // BB Code image with align
|
21 |
| -$_patterns[] = '/\[img\s+align=([\'"]?)(left|center|right)\1(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\3)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\5)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\7)?]([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/img\]/US'; |
| 21 | +$_patterns[] = '/\[img\s+align=([\'"]?)(left|center|right)\1(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\3)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\5)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\7)?]([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/img\]/U'; |
22 | 22 | $_replaces[] = '&ref($9,$2,"t:$4",mw:$6,mw:$8);';
|
23 | 23 |
|
24 | 24 | // BB Code image normal
|
25 |
| -$_patterns[] = '/\[img(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\1)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\3)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\5)?]([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/img\]/US'; |
| 25 | +$_patterns[] = '/\[img(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\1)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\3)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\5)?]([!~*\'();\/?:\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/img\]/U'; |
26 | 26 | $_replaces[] = '&ref($7,"t:$2",mw:$4,mw:$6);';
|
27 | 27 |
|
28 | 28 | // BB Code siteimage with align
|
29 |
| -$_patterns[] = '/\[siteimg\s+align=([\'"]?)(left|center|right)\1(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\3)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\5)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\7)?]\/?([!~*\'();?\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/siteimg\]/US'; |
| 29 | +$_patterns[] = '/\[siteimg\s+align=([\'"]?)(left|center|right)\1(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\3)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\5)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\7)?]\/?([!~*\'();?\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/siteimg\]/U'; |
30 | 30 | $_replaces[] = '&ref(site://$9,$2,"t:$4",mw:$6,mw:$8);';
|
31 | 31 |
|
32 | 32 | // BB Code siteimage normal
|
33 |
| -$_patterns[] = '/\[siteimg(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\1)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\3)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\5)?]\/?([!~*\'();?\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/siteimg\]/US'; |
| 33 | +$_patterns[] = '/\[siteimg(?:\s+title=([\'"]?)([^\'"][^\]\s]*)\1)?(?:\s+w(?:idth)?=([\'"]?)([\d]+)\3)?(?:\s+h(?:eight)?=([\'"]?)([\d]+)\5)?]\/?([!~*\'();?\@&=+\$,%#_0-9a-zA-Z.-][!~*\'();\/?\@&=+\$,%#_0-9a-zA-Z.-]+)\[\/siteimg\]/U'; |
34 | 34 | $_replaces[] = '&ref(site://$7,"t:$2",mw:$4,mw:$6);';
|
35 | 35 |
|
36 | 36 | $root->str_rules['bbcode_image'] = array($_patterns, $_replaces);
|
|
0 commit comments