Welcome Guest, Not a member yet? Register   Sign In
CI 3.1.11, PHP 7.4, url_helper Critical Error

(This post was last modified: 12-05-2020, 12:22 PM by JustBoo. Edit Reason: Formatting )

Hello. I've been running CI 3.0.6 with PHP 5.6 and 7.2 for years with no problems.

I had to upgrade my PHP version to 7.4 due to my ISP. The site now has the error below:

Message:  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Filename: helpers/url_helper.php

Line Number: 162

I cannot upgrade to CI 4.x at this time. So I upgraded to 3.1.11.

The offending code is:

PHP Code:
$site_url is_array($uri)
: (
preg_match('#^(\w+:)?//#i'$uri) ? $uri site_url($uri)); 

Since I don't get a valid url everything is messed up. (No CSS, etc.)

Frankly I don't use PHP enough to know how to convert the is_array() to make use of the parens that PHP 7.4 now wants. Searching came up dry for me.

Any help would be deeply appreciated.  Thank you.

Messages In This Thread
CI 3.1.11, PHP 7.4, url_helper Critical Error - by JustBoo - 12-05-2020, 12:01 PM

Theme © iAndrew 2016 - Forum software by © MyBB