php 7.x warning: “Deprecated: Unparenthesized …” – FIX
-
Hi all!
If you receive the php warning:Deprecated: Unparenthesized 'a ? b : c ? d : e' is deprecated. Use either '(a ? b : c) ? d : e' or 'a ? b : (c ? d : e)' in /path/to/wp-content/plugins/honeypot-toolkit/lib/HoneypotToolkit.class.php on line xxx
Here is the fix:
change line 209 from:
$activityNotes .= (isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST']))? htmlentities($_SERVER['HTTP_HOST']):'';
to:
$activityNotes .= ((isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST'])))? htmlentities($_SERVER['HTTP_HOST']):'';
change line 337 from:
$activityNotes .= (isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST']))? htmlentities($_SERVER['HTTP_HOST']):'';
to:
$activityNotes .= ((isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST'])))? htmlentities($_SERVER['HTTP_HOST']):'';
change line 364 from:
$activityNotes .= ((isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST']))? htmlentities($_SERVER['HTTP_HOST']):'');
to:
$activityNotes .= (((isset($_SERVER['SERVER_NAME']))? htmlentities($_SERVER['SERVER_NAME']):(isset($_SERVER['HTTP_HOST'])))? htmlentities($_SERVER['HTTP_HOST']):'');
Hopefully Jeff will have some time to fix this and push out an update.
Thanks!
Brian Brown, Ph.D
@brianbrown
- The topic ‘php 7.x warning: “Deprecated: Unparenthesized …” – FIX’ is closed to new replies.