X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fdiogenes.compose.inc.php;h=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hb=b83c2cd955fee7bf470dc99406dfdc7dd4246491;hp=1d5bef0b04c9a2ede9aa86486d3bc4fa79ef148e;hpb=4ae77f9e9185e6fb547d32281bb2aef6f299841e;p=diogenes.git diff --git a/include/diogenes.compose.inc.php b/include/diogenes.compose.inc.php index 1d5bef0..e69de29 100644 --- a/include/diogenes.compose.inc.php +++ b/include/diogenes.compose.inc.php @@ -1,81 +0,0 @@ -)/",$input,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $output = ""; - - while ($block = array_shift($splits)) { - if ($block == "") - die("phpProtect : parse error"); - $output .= "{PHP:".base64_encode($code).":PHP}"; - } else { - $output .= $block; - } - } - - return $output; -} - - -/** Unprotect PHP code. - */ -function phpUnprotect($input) -{ - $splits = preg_split("/({PHP:.+:PHP})/",$input,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $output = ""; - - foreach ($splits as $block) { - if (preg_match("/{PHP:(.+):PHP}/",$block,$match)) { - $output .= ""; - } else { - $output .= $block; - } - } - - return $output; -} - - -/** Convert XHTML-compliant tags to plain HTML. - */ -function xhtmlToHtml($input) -{ - return html_accent(preg_replace("/<(br|img|input|p)( [^\/]*)?\/>/","<\$1\$2>",$input)); -} - - -/** Restore XHTML-compliant tags. - */ -function htmlToXhtml($input) -{ - return preg_replace("/<(br|img|input)( [^>]+)?>/","<\$1\$2/>",$input); -} - -?>