Re: call to undefined function which is defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bing Du wrote:
Hi,

RHEL 4
PHP 4.3.9
Apache 2.0.52

Without knowing much about the web application we use, can anybody tell me
what kind of situation could trigger the following 'call to undefined
function' error?

PHP Fatal error:  Call to undefined function:  encryptchar
code() in /data/www/html/typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.p
hp on line 3439

Line 3439 is:

$out .= $this->encryptCharcode($charValue,0x61,0x7A,$offset);

Here is the function block that has line 3439.

function encryptEmail($string,$back=0)  {
                $out = '';

                if ($this->spamProtectEmailAddresses === 'ascii') {
                        for ($a=0; $a<strlen($string); $a++) {
                                $out .= '&#'.ord(substr($string, $a, 1)).';';
                        }
                } else  {
                                // like str_rot13() but with a variable
offset and a wider character range
                        $len = strlen($string);
                        $offset =
intval($this->spamProtectEmailAddresses)*($back?-1:1);
                        for ($i=0; $i<$len; $i++)       {
                                $charValue = ord($string{$i});
                                if ($charValue >= 0x2B && $charValue <=
0x3A)   {       // 0-9 . , - + / :
                                        $out .=
$this->encryptCharcode($charValue,0x2B,0x3A,$offset);
                                } elseif ($charValue >= 0x40 && $charValue
<= 0x5A)     {       // A-Z @
                                        $out .=
$this->encryptCharcode($charValue,0x40,0x5A,$offset);
                                } else if ($charValue >= 0x61 &&
$charValue <= 0x7A)    {       // a-z
                                        $out .=
$this->encryptCharcode($charValue,0x61,0x7A,$offset);
                                } else {
                                        $out .= $string{$i};
                                }
                        }
                }
                return $out;
        }

And the encryptCharcode() function the fatal error complained about is
defined right before encrytEmail().

==
 function encryptCharcode($n,$start,$end,$offset)        {
                $n = $n + $offset;
                if ($offset > 0 && $n > $end)   {
                        $n = $start + ($n - $end - 1);
                } else if ($offset < 0 && $n < $start)  {
                        $n = $end - ($start - $n - 1);
                }
                return chr($n);
        }
==

I don't understand why the error is about a function that's defined fine??

Thanks in advance for any help,

Bing

you are calling it as a method to an object. Is it actually defined within that object or a parent object??

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux