Changeset 7
- Timestamp:
- 02/13/05 07:44:00 (8 years ago)
- Location:
- trunk/plugins/SuperClean
- Files:
-
- 2 modified
-
super-clean.js (modified) (1 diff)
-
tidy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SuperClean/super-clean.js
r1 r7 78 78 if(this.config.tidy_handler && opts.tidy) 79 79 { 80 HTMLArea._postback(this.config.tidy_handler, {'content' : this.get HTML()},80 HTMLArea._postback(this.config.tidy_handler, {'content' : this.getInnerHTML()}, 81 81 function(javascriptResponse) { eval(javascriptResponse) }); 82 82 } -
trunk/plugins/SuperClean/tidy.php
r1 r7 26 26 } 27 27 } 28 29 header('Content-Type: text/javascript; charset=utf-8'); 28 30 29 31 /** Function to POST some data to a URL */ … … 99 101 if(trim(@$_REQUEST['content'])) 100 102 { 103 // PHP's urldecode doesn't understand %uHHHH for unicode 104 $_REQUEST['content'] = preg_replace('/%u([a-f0-9]{4,4})/ei', 'utf8_chr(0x$1)', $_REQUEST['content']); 105 function utf8_chr($num) 106 { 107 if($num<128)return chr($num); 108 if($num<1024)return chr(($num>>6)+192).chr(($num&63)+128); 109 if($num<32768)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); 110 if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); 111 return ''; 112 } 101 113 ob_start(); 102 passthru("echo " . escapeshellarg($_REQUEST['content']) . " | tidy -q -i - wrap 99992>/dev/null", $result);114 passthru("echo " . escapeshellarg($_REQUEST['content']) . " | tidy -q -i -u -wrap 9999 -utf8 -bare -asxhtml 2>/dev/null", $result); 103 115 $content = ob_get_contents(); 104 116 ob_end_clean();
