Change WordPress user roles and capabilities Forums Bug Reports Syntax error, unexpected '[' in other-roles-access.php on line 364

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4537
    amattioli
    Spectator

    Hi Vladimir

    I installed User Role Editor Pro on a WordPress 4.9.1 and PHP version 5.3.3
    I try to activate the plugin but it throws this error
    **
    Can’t activate plugin, fatal error
    Parse error: syntax error, unexpected ‘[‘ in /[my path]/htdocs/wp-content/plugins/user-role-editor-pro/pro/includes/classes/other-roles-access.php on line 364

    **

    Before the PRO version, I used the non-pro version without any problem.
    Is the PHP version the problem? I cannot update it though
    Can you help me?

    Thanks
    Cinzia

    #4538
    Vladimir
    Keymaster

    Hi Cinzia,

    Yes, it’s related to the PHP version.
    Workaround: replace noted line 364 with this code:

    
    if (is_array($caps) & count($caps)>0) {
        $caps_val = array_values($caps);
        $cap = $caps_val[0];
    } else {
        $cap = $caps;
    }
    

    I will include this change to the next update.

    Pay a serious attention that even version 5.5 does not receive the security updates already: http://php.net/supported-versions.php

    #4539
    amattioli
    Spectator

    Thanks!
    Everything works fine now.

    I’m aware of the security issue, I’m working on it to move forward

    Thanks thanks
    Cinzia

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.