lat9 / usu

Ultimate SEO URLs for Zen Cart
GNU General Public License v3.0
1 stars 5 forks source link

includes/classes/usu.php - PHP 7.3 warnings #22

Closed webchills closed 5 years ago

webchills commented 5 years ago

Using PHP 7.3 the logs folder gets flooded by warnings: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /.../includes/classes/usu.php on line 1062.

protected function short_name($str, $limit=3) { if(defined('USU_FILTER_SHORT_WORDS')) { $limit = (int)USU_FILTER_SHORT_WORDS; } $foo = @explode('-', $str); $container = array(); foreach ($foo as $index => $value){ switch (true) { case (strlen($value) <= $limit): continue; default: $container[] = $value; break; } } # end foreach $container = (sizeof($container) > 1) ? implode('-', $container) : $str; return $container; } continue should be changed

lat9 commented 5 years ago

Thanks for the notification, @webchills. This plugin is on my list of PHP 7.2/7.3 updates.

webchills commented 5 years ago

There is more to fix in this file to avoid logs like this: Use of undefined constant ENABLE_SSL - assumed 'ENABLE_SSL' (this will throw an Error in a future version of PHP) in includes/classes/usu.php on line 201

lat9 commented 5 years ago

I'm assuming that this is logged from the admin only, please advise.

lat9 commented 5 years ago

Update provided.