1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Zend_Filter help required please

Discussion in 'XenForo Development Discussions' started by Marcel, Apr 7, 2015.

  1. Marcel

    Marcel Active Member

    Using Robbo's xfgamer45's Ad Manager is fine on PHP 5.3, however 5.4 and above it throws a depreciated /e modifier error, just like in this old bug report
    https://xenforo.com/community/threads/errors-when-using-debug-mode-beta-4.54046/

    The full error text is :

    If I've done this correctly, it is step 5 that's the issue, the function code is :

    Code:
    public static function underscoreToCamelCase($string, $lowerCaseFirst = false)
            {
                $ret = Zend_Filter::filterStatic($string, 'Word_UnderscoreToCamelCase');
                return $lowerCaseFirst ? lcfirst($ret) : $ret;
            }
    It's a long shot, but is this the function that's causing the issue when it calls the relevant part of the Zend Framework? If so, how do I change it to become compliant?

    Any ideas? Thanks in advance.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    I think using regex and a callback to achieve this is overkill.

    PHP:
    $string 'underscore_to_camel_case';
    $string str_replace(' '''ucwords(str_replace('_'' '$string)));
    That would return UnderscoreToCamelCase.

    Naturally you can modify the first character accordingly should you need to.
     
  3. Marcel

    Marcel Active Member

    That's done the ticket, cheers :)
     

Share This Page