+ Reply to Thread
Results 1 to 6 of 6

Thread: Fatal error call to undefined function

  1. #1

    Fatal error call to undefined function

    Fatal error: Call to undefined function utf8_is_ascii() in /home/aaa1111/public_html/includes/classes/rlValid.class.php on line 324
    The function is defined in 'ascii.php' --- ..function utf8_is_ascii($str) {
    // Search for any bytes which are outside the ASCII range
    return (preg_match('/(?:[^\x00-\x7F])/',$str) !== 1);
    }
    ================================================== =WHY ERROR
    loadUTF8functions('ascii', 'utf8_to_ascii', 'utf8_is_ascii');

    if (!utf8_is_ascii($str)) { <<<<<<====line 324===>>>
    if ($GLOBALS['config']['url_transliteration']) {
    $str = utf8_to_ascii($str);
    $str = preg_replace("/[^a-z0-9{$rx}]+/i", '-', $str);
    } else {
    $str = preg_replace('/[\s#%@;=\?\^\|~]+/', '-', $str);
    }
    } else {
    $str = preg_replace("/[^a-z0-9{$rx}]+/i", '-', $str);
    }

    $str = preg_replace("/\.+/i", '-', $str);
    $str = preg_replace('/\-+/', '-', $str);
    $str = strtolower($str);
    $str = trim($str, '-');
    $str = trim($str, '/');
    $str = trim($str);

    return empty($str) ? false : $str;
    }

  2. #2
    Hello Rintu,

    Open file: ftp://include>>classes>>rlValid.class.php

    find method: str2key remove it and use following code:

    PHP Code:
    Only registered members can view the code
    Viktor,
    Flynax technical department,
    Best wishes.

  3. #3
    Sup Viktor, Yea I did not think to try that before I did what I did. What I did worked but it was way round about but I was freaking out and had to do something.
    First I put all files into the trash.
    Reintalled.
    Then I simply transferred all the files that I wanted to keep. This includes imgs, php, css, html. I made sure not to disturb core php funtions as i believe my original issue "Fatal Error" was due to me messing around in utf8 db. It works smoothly so far but i seriously doubt if It would have been as quick as your solution.
    Moral of the day: Ask for help, be patient enough to wait for it.

  4. #4
    ....Buuuut do I still need to change that?

  5. #5
    Problem only in this function. You need to take my code and put instead of current 'str2path' function only and all will work I hope.
    Viktor,
    Flynax technical department,
    Best wishes.

  6. #6
    It already had the code but I had to reinstall again becuase dbi.php. Thanks


    function str2key( $key, $replace = '_' )
    {

    $key = preg_replace( '/[^a-zA-Z0-9\+]+/i', $replace, $key );
    //$key = preg_replace( '/\-+/', $replace, $key );
    $key = strtolower($key);
    $key = trim( $key, $replace );

    return empty($key) ? false : $key;
    }

    /**
    * convert string to path
    *
    * @param string $str - string
    *
    * @return string - valid key
    **/
    function str2path($str, $keep_slashes = false) {
    if ($keep_slashes) {
    $rx = '\/';
    }

    loadUTF8functions('ascii', 'utf8_to_ascii', 'utf8_is_ascii');

    if (!utf8_is_ascii($str)) {
    if ($GLOBALS['config']['url_transliteration']) {
    $str = utf8_to_ascii($str);
    $str = preg_replace("/[^a-z0-9{$rx}]+/i", '-', $str);
    } else {
    $str = preg_replace('/[\s#%@;=\?\^\|~]+/', '-', $str);
    }
    } else {
    $str = preg_replace("/[^a-z0-9{$rx}]+/i", '-', $str);
    }

    $str = preg_replace("/\.+/i", '-', $str);
    $str = preg_replace('/\-+/', '-', $str);
    $str = strtolower($str);
    $str = trim($str, '-');
    $str = trim($str, '/');
    $str = trim($str);

    return empty($str) ? false : $str;
    }

+ Reply to Thread