We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96593e2 commit 95aa2feCopy full SHA for 95aa2fe
src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
@@ -62,13 +62,25 @@ protected function transform($key, $value)
62
{
63
$except = array_merge($this->except, static::$neverTrim);
64
65
- if (in_array($key, $except, true) || ! is_string($value)) {
+ if ($this->shouldSkip($key, $except) || ! is_string($value)) {
66
return $value;
67
}
68
69
return Str::trim($value);
70
71
72
+ /**
73
+ * Determine if the given key should be skipped.
74
+ *
75
+ * @param string $key
76
+ * @param array $except
77
+ * @return bool
78
+ */
79
+ protected function shouldSkip($key, $except)
80
+ {
81
+ return in_array($key, $except, true);
82
+ }
83
+
84
/**
85
* Indicate that the given attributes should never be trimmed.
86
*
0 commit comments