[ZendTo] Error after upgrade
Dale E. Qualls
deq at pattishall.com
Wed Feb 1 14:35:24 GMT 2017
I know I'm on 5.2.17, I checked that out yesterday and did some googling and it said that the ?: was fine after 5.2 but the older version is probably the issue. Will anything break if I upgrade to 5.3?
php --version
PHP 5.2.17 (cli) (built: Jan 11 2011 11:13:37)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
md5sum /opt/zendto/lib/NSSUtils.php
e382d79b8aded31d177861a86f69738c /opt/zendto/lib/NSSUtils.php
php -l /opt/zendto/lib/NSSUtils.php
No syntax errors detected in /opt/zendto/lib/NSSUtils.php
Thanks, Jules!!
[http://www.pattishall.com/imgs/pattishalllogo.jpg]
Dale E. Qualls
Director of Information Technology
Pattishall, McAuliffe, Newbury, Hilliard & Geraldson LLP
200 South Wacker Drive, Suite 2900
Chicago, IL 60606-5896
Direct: (312) 554-7979 Main: (312) 554-8000 Fax: (312) 554-8015
deq at pattishall.com<mailto:deq at pattishall.com> www.pattishall.com<http://www.pattishall.com> Follow us on Twitter<http://www.twitter.com/Pattishall>
From: zendto-bounces at zend.to [mailto:zendto-bounces at zend.to] On Behalf Of Jules
Sent: Wednesday, February 01, 2017 3:17 AM
To: ZendTo Users
Subject: Re: [ZendTo] Error after upgrade
Dale,
Please can you run 3 commands for me and send me the output of them:
php --version
md5sum /opt/zendto/lib/NSSUtils.php
php -l /opt/zendto/lib/NSSUtils.php
If you are running PHP earlier than 5.3, you will almost certainly get a syntax error of some sort on that line, as prior to 5.3 you couldn't skip the value between the "?" and the ":".
If that turns out to be the cause, replace that line with these 2:
$the_ip = filter_var($the_ip, FILTER_VALIDATE_IP);
$the_ip = $the_ip ? $the_ip : '0.0.0.0';
That should achieve the same thing, if my brain is attached correctly this morning.
Please do let me know how you get on.
Cheers,
Jules.
On 31/01/2017 16:49, Dale E. Qualls wrote:
I upgraded today (yum update zendto) and everything appeared to update normally.
Trying to open the site in the browser, I received this:
Parse error: syntax error, unexpected ';' in /opt/zendto/lib/NSSUtils.php on line 193
The only semicolon on that line is the one at the end:
/* Fetch the REMOTE_ADDR of the http connection, even through proxies */
function getClientIP()
{
// Get the forwarded IP if it exists
if ( isset($_SERVER['HTTP_CLIENT_IP']) && array_key_exists('HTTP_CLIENT_IP', $_SERVER) ) {
$the_ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER )) {
$the_ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$the_ip = trim($the_ips[0]);
} else {
$the_ip = $_SERVER['REMOTE_ADDR'];
}
// Now validate it
$the_ip = filter_var($the_ip, FILTER_VALIDATE_IP) ?: '0.0.0.0'; <-------------THIS IS LINE 193
return $the_ip;
}
Any thoughts or suggestions?
[http://www.pattishall.com/imgs/pattishalllogo.jpg]
Dale E. Qualls
Director of Information Technology
Pattishall, McAuliffe, Newbury, Hilliard & Geraldson LLP
200 South Wacker Drive, Suite 2900
Chicago, IL 60606-5896
Direct: (312) 554-7979 Main: (312) 554-8000 Fax: (312) 554-8015
deq at pattishall.com<mailto:deq at pattishall.com> www.pattishall.com<http://www.pattishall.com> Follow us on Twitter<http://www.twitter.com/Pattishall>
[http://images.pattishall.com/images/25pixelimage.gif]
[http://images.pattishall.com/images/25pixelimage.gif]
[http://images.pattishall.com/images/blf-badge.jpg]
[http://images.pattishall.com/images/25pixelimage.gif]
Pattishall Ranks GOLD in the United States and in Illinois in the prestigious
WTR 1000
[http://images.pattishall.com/images/25pixelimage.gif]
[http://images.pattishall.com/images/2014chambers-65.jpg]
[http://images.pattishall.com/images/25pixelimage.gif]
[http://images.pattishall.com/images/2013gototop500.jpg]
________________________________
The preceding message and any attachments may contain confidential information protected by the attorney-client or other privilege. You may not forward this message or any attachments without the permission of the sender. If you believe that it has been sent to you in error, please reply to the sender that you received the message in error and then delete it. Nothing in this email message, including the typed name of the sender and/or this signature block, is intended to constitute an electronic signature unless a specific statement to the contrary is included in the message.
________________________________
_______________________________________________
ZendTo mailing list
ZendTo at zend.to<mailto:ZendTo at zend.to>
http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto<http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto>
Jules
--
Julian Field MEng MBCS CITP CEng
'It's very unlikely indeed he will ever recover consciousness, and
if he does he won't be the Julian you knew.'
- A hospital consultant I proved very wrong in 2007 :-)
www.Zend.To<http://www.Zend.To>
Twitter: @JulesFM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20170201/9dd25d3b/attachment-0001.html
More information about the ZendTo
mailing list