• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Got an error message in new beta9 after fresh install

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
8 posts • Page 1 of 1

Postby PyTh0n » Tue Feb 20, 2007 10:25 am

After fresh install got a JavaScript error popup, saying:

"Error: the XML response that was returned from the server is invalid.
Received:


<b>Fatal error</b>: Call to undefined function ctype_space() in <b>/var/www/chat/public_html/beta9/phpfreechat/lib/csstidy-1.2/class.csstidy.php</b> on line <b>591</b>


You have whitespace at the end of your response."

beta8 works fine, without troubles, but all beta9: pre2, pre3 and new beta9 bring that popup in all browsers (Opera, Konqueror, Mozilla).
I've checked class.csstidy.php - hey, it really hasn't any definition of function ctype_space() ! How did you manage to get this beta work on your site?
As far as I know, there wasn't any csstidy in beta8, therefore problem emerges at csstidy. How can I avoid this problem?

If that could help you: gentoo-2.6.18-r5, apache 2.0.58-r2, php-5.1.6-r6, example at http://shu-shu.info/talking/beta9/phpfreechat/

And another problem that I can reproduce at your demo - Cannot post " character. You can enter as many "s (double quotes) as you want, but noone will be displayed. If message contains only """ - chat will say "Text cannot be empty"

Anyway, thanks, your chat is great! PyTh0n.
Last edited by PyTh0n on Tue Feb 20, 2007 10:39 am, edited 1 time in total.
PyTh0n
New member
 
Posts: 2
Joined: Sat Feb 17, 2007 10:56 pm
Location: Russia
  • Website
  • ICQ
Top

Postby Andreas » Tue Feb 20, 2007 12:12 pm

You need php-ctype available on your server in order to use ctype_space()

On Gentoo systems to enable ctype functions you need to set the use flag for php "ctype"
Andreas
New member
 
Posts: 7
Joined: Sun Feb 18, 2007 10:01 am
Location: Germany
  • Website
Top

Postby PyTh0n » Tue Feb 20, 2007 2:36 pm

Thanks! That helped me a lot! Think that should be included in "required configuration".
What about second problem? Any ideas?
PyTh0n
New member
 
Posts: 2
Joined: Sat Feb 17, 2007 10:56 pm
Location: Russia
  • Website
  • ICQ
Top

Postby phpfreechat » Tue Feb 20, 2007 2:50 pm

Does anybody knows if the ctype_* functions can be written differently ?

The problem is that the new styles loading process uses csstidy for css parsing so phpfreechat depends on csstidy bugs and restrictions.
An alternative could be to write the ctype_* functions family differently.


The second problem is known. It's not yet fixed.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Andreas » Tue Feb 20, 2007 5:25 pm

kerphi wrote:Does anybody knows if the ctype_* functions can be written differently ?

As far as i see you only use ctype_space() && ctype_xdigit() in the project.
Code: Select all
<?php

function my_ctype_space($string)
{
   return preg_match('/^[s]$/', $string);
}

function my_ctype_xdigit($string)
{
   return !preg_match('/[^0123456789ABCDEFabcdef]/', $string);
}

// examples for verifying
$test[] = "";
$test[] = "t";
$test[] = "r";
$test[] = "n";
$test[] = "                  ";
$test[] = "n-";
$test[] = " x";
$test[] = "12 3";
$test[] = ".  abc";
$test[] = "abc";
$test[] = "ABC9";
$test[] = "aBcF4";
$test[] = "0123456789ABCDEFabcdef";
$test[] = "034DEFa5612789ABCbcdef";
$test[] = "012djgfbbku3456789ABCDEFabcdef";


echo "ctype_space()"."<br />";
foreach ($test as $a)
{
   echo $a .  " : " . ((my_ctype_space($a)) ? "true" : "false") ." : " . ((ctype_space($a)) ? "true" : "false") ."<br />";
}


echo "ctype_xdigit()"."<br />";
foreach ($test as $a)
{
   echo $a .  " : " . ((my_ctype_xdigit($a)) ? "true" : "false").  " : " . ((ctype_xdigit($a)) ? "true" : "false") ."<br />";
}
 ?>

This should have the exact same behaviour.
Last edited by Andreas on Tue Feb 20, 2007 7:10 pm, edited 1 time in total.
Andreas
New member
 
Posts: 7
Joined: Sun Feb 18, 2007 10:01 am
Location: Germany
  • Website
Top

Postby phpfreechat » Tue Feb 20, 2007 6:31 pm

ctype_alpha seams to be also used.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Andreas » Tue Feb 20, 2007 6:47 pm

Code: Select all
function my_ctype_alpha($string)
{
   return !preg_match('/[^A-Za-z]/', $string);
}
Andreas
New member
 
Posts: 7
Joined: Sun Feb 18, 2007 10:01 am
Location: Germany
  • Website
Top

Postby phpfreechat » Tue Feb 20, 2007 6:55 pm

Ok I integrated your work bu I modified a bit the regex, here is the final code :
Code: Select all
if (!function_exists('ctype_alpha')) {
  function ctype_alpha($string)
  {
    return preg_match('/^[a-z]+$/i', $string);
  }
}

if (!function_exists('ctype_xdigit')) {
  function ctype_xdigit($string)
  {
    return preg_match('/^[0-9a-f]+$/i', $string);
  }
}

if (!function_exists('ctype_space')) {
  function ctype_space($string)
  {
    return preg_match('/^[s]$/', $string);
  }
}

don't hesitate to give me some feedback.

PyTh0n, could you try with the svn trunk ? this fix is present in 977 revision.
Keep me informed.

regards,
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 31 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub