Support » Plugin: Redirection » Make sure $regex is boolean when you compare it in sanitize_url()

  • Caspie

    (@caspie)


    In Red_Item class, create() method line 179 you are setting $regex to be integer 1 or 0 based on some conditions. Then few lines bellow on line 193 you are calling sanitize_url with that same $regex. In sanitize_url() you are ensuring there is a slash at the start of the URL but your conditional check includes $regex === false, which will fail always because $regex is integer. Maybe you could typecast $regex to boolean in that condition in the function, to make sure you are comparing the right types.

    This is also the case in the update() method of Red_Item class.

  • The topic ‘Make sure $regex is boolean when you compare it in sanitize_url()’ is closed to new replies.