From 25e1c4be6e78d4fd204b8f068db775da31eb6143 Mon Sep 17 00:00:00 2001 From: kerphi Date: Tue, 20 Feb 2007 17:53:57 +0000 Subject: [PATCH] =?UTF-8?q?[en]=20Makes=20compatible=20csstidy=20and=20php?= =?UTF-8?q?=20without=20ctype=20enabled=20(thanks=20to=20Andreas)=20[0h40]?= =?UTF-8?q?=20[fr]=20Rend=20compatible=20la=20librairie=20csstidy=20pour?= =?UTF-8?q?=20les=20installations=20de=20php=20n'ayant=20pas=20le=20module?= =?UTF-8?q?=20ctype=20(merci=20=C3=A0=20Andreas)=20[0h40]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://phpfreechat.svn.sourceforge.net/svnroot/phpfreechat/trunk@977 2772adf2-ac07-0410-9d30-e29d8120292e --- lib/ctype/ctype.php | 24 ++++++++++++++++++++ src/phpfreechat.class.php | 1 + testcase/ctype.php | 47 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 lib/ctype/ctype.php create mode 100644 testcase/ctype.php diff --git a/lib/ctype/ctype.php b/lib/ctype/ctype.php new file mode 100644 index 00000000..5d15977e --- /dev/null +++ b/lib/ctype/ctype.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/src/phpfreechat.class.php b/src/phpfreechat.class.php index 30ba2f9a..5f124bd9 100644 --- a/src/phpfreechat.class.php +++ b/src/phpfreechat.class.php @@ -381,6 +381,7 @@ function loadStyles($theme = 'default', &$xml_reponse) $js = '';//file_get_contents(dirname(__FILE__).'/client/createstylerule.js'); $js .= 'var c = $H();'; $path = $c->getFilePathFromTheme('style.css.php'); + require_once dirname(__FILE__).'/../lib/ctype/ctype.php'; // to keep compatibility for php without ctype support require_once dirname(__FILE__).'/../lib/csstidy-1.2/class.csstidy.php'; $css = new csstidy(); $css->set_cfg('preserve_css',false); diff --git a/testcase/ctype.php b/testcase/ctype.php new file mode 100644 index 00000000..5e4fe767 --- /dev/null +++ b/testcase/ctype.php @@ -0,0 +1,47 @@ +"; +foreach ($test as $a) +{ + echo $a . " : " . ((my_ctype_space($a)) ? "true" : "false") ." : " . ((ctype_space($a)) ? "true" : "false") ."
"; +} + + +echo "ctype_xdigit()"."
"; +foreach ($test as $a) +{ + echo $a . " : " . ((my_ctype_xdigit($a)) ? "true" : "false"). " : " . ((ctype_xdigit($a)) ? "true" : "false") ."
"; +} + +echo "ctype_alpha()"."
"; +foreach ($test as $a) +{ + echo $a . " : " . ((my_ctype_alpha($a)) ? "true" : "false") ." : " . ((ctype_alpha($a)) ? "true" : "false") ."
"; +} + +?> \ No newline at end of file