Commit | Line | Data |
---|---|---|
51ff3226 | 1 | <?php |
3676f242 H |
2 | require_once(INCLUDE_DIR.'base36.inc'); |
3 | ||
51ff3226 | 4 | if (!function_exists('str_split')){ |
5 | function str_split($string, $split_length=1){ | |
6 | ||
7 | if ($split_length < 1){ | |
8 | return false; | |
9 | } | |
10 | ||
11 | for ($pos=0, $chunks = array(); $pos < strlen($string); $pos+=$split_length){ | |
12 | $chunks[] = substr($string, $pos, $split_length); | |
13 | } | |
14 | return $chunks; | |
15 | } | |
16 | } | |
17 | ||
3676f242 | 18 | function processContent_hack($node_content) { |
51ff3226 | 19 | global $node; |
e909f81b | 20 | include_once(INCLUDE_DIR.'htmlparse.inc'); |
51ff3226 | 21 | |
22 | if ($node['template_id']==$node['node_id'] && $_POST['event']=='configure_content') { | |
23 | ||
24 | } | |
25 | ||
26 | elseif ($_POST['no_html']) { | |
27 | $node_content=htmlspecialchars($node_content); | |
28 | } | |
29 | ||
30 | elseif ($_POST['wiki']) { | |
31 | // load the class file | |
32 | require_once 'Text/Wiki.php'; | |
33 | ||
34 | // instantiate a Text_Wiki object with the default rule set | |
63c0e85f | 35 | $wiki = new Text_Wiki(); |
51ff3226 | 36 | |
37 | $node_content = $wiki->transform($node_content, 'Xhtml'); | |
38 | } | |
39 | ||
40 | elseif ($_POST['code']) {} | |
41 | ||
42 | else { | |
43 | global $db,$htmlparse,$error; | |
44 | ||
54bc3775 | 45 | if (!htmlparser::htmlparse($node_content)) { |
51ff3226 | 46 | $error=$htmlparse; |
47 | return false; | |
48 | } | |
49 | ||
50 | $node_content = eregi_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2<a target='_blank' href=\"\\6\\7\">\\6\\7</a>",$node_content); | |
92d9f727 | 51 | //$node_content = mysql_real_escape_string($node_content); once is enough |
51ff3226 | 52 | } |
53 | ||
54 | return $node_content; | |
55 | } | |
56 | ||
57 | ||
3676f242 | 58 | require_once(BACKEND_DIR.'/'.DB_TYPE.'/backend.inc'); |
51ff3226 | 59 |