From 2cdc9dbe8fa202517fd7b67e153ce8da4301423a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 8 Nov 2014 00:29:50 +0100 Subject: [PATCH] Fix PHP error "Only variables should be passed by reference" --- code/web/public_php/admin/nel/nel_message.php | 5 +++-- code/web/public_php/tools/nel_message.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/web/public_php/admin/nel/nel_message.php b/code/web/public_php/admin/nel/nel_message.php index 5e704bff1..42dd91cbe 100644 --- a/code/web/public_php/admin/nel/nel_message.php +++ b/code/web/public_php/admin/nel/nel_message.php @@ -91,9 +91,10 @@ } else { - $this->serialUInt32(strlen($val)); + $valLen = strlen($val); + $this->serialUInt32($valLen); $this->Buffer .= $val; - $this->Pos += strlen($val); + $this->Pos += $valLen; debug(sprintf ("write string '%s' %d
\n", $val, $this->Pos)); } } diff --git a/code/web/public_php/tools/nel_message.php b/code/web/public_php/tools/nel_message.php index ee3177f8d..b696bb151 100644 --- a/code/web/public_php/tools/nel_message.php +++ b/code/web/public_php/tools/nel_message.php @@ -104,7 +104,8 @@ } else { - $this->serialUInt32($val->toInt()); + $intValue = $val->toInt(); + $this->serialUInt32($intValue); debug(sprintf ("write enum '%s' %d
\n", $val->toString(), $this->Pos)); } }