Skip to content

Commit 0808545

Browse files
Made sure that >=7.2.5 <8.5 php versions work and do not give deprecation warnings
1 parent 43c4781 commit 0808545

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"require": {
1616
"mustache/mustache": "^2.11.1",
1717
"guzzlehttp/guzzle": "~7.0",
18-
"php": ">=7.2.5",
18+
"php": ">=7.2.5 <8.5",
1919
"psr/log": "^1.0.2"
2020
},
2121
"config": {

px_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.10.2",
2+
"version": "4.0.0",
33
"supported_features": [
44
"additional_activity_handler",
55
"advanced_blocking_response",

src/PerimeterxContext.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ private function extractIP($pxConfig, $headers)
135135
*/
136136
protected $uri;
137137

138+
/**
139+
* @var bool whether the route is sensitive.
140+
*/
141+
protected $sensitive_route;
142+
138143
/**
139144
* @var string user's user agent.
140145
*/

src/PerimeterxHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function fixJsonBody($jsonArray)
7878
function(&$value, $key) // assume key is ok, no need to fix it
7979
{
8080
if (is_string($value)) {
81-
$value = utf8_encode($value);
81+
$value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
8282
} elseif ($value instanceof \stdClass) {
8383
$value = self::fixJsonBody(get_object_vars($value));
8484
}

src/PerimeterxLogger.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function log($level, $message, array $context = [])
4949
throw new InvalidArgumentException($level . ' is not a defined level in the PSR-3 specification.');
5050
}
5151

52-
error_log($this->interpolate((string)$message, $context, $level));
52+
error_log($this->interpolate((string)$message, $level, $context));
5353
}
5454

5555
/**
@@ -61,11 +61,12 @@ public function log($level, $message, array $context = [])
6161
* > - Placeholder names MUST be delimited with a single opening brace { and a single closing brace }. There MUST NOT be any whitespace between the delimiters and the placeholder name.
6262
*
6363
* @param string $message
64+
* @param string $level
6465
* @param array $context
6566
*
6667
* @return string
6768
*/
68-
private function interpolate($message, array $context = [], $level)
69+
private function interpolate($message, $level, array $context = [])
6970
{
7071
// build a replacement array with braces around the context keys
7172
$replace = [];

0 commit comments

Comments
 (0)