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 2792177 commit a51dcb6Copy full SHA for a51dcb6
laravel/app/Http/Controllers/Bus/ToolController.php
@@ -43,10 +43,17 @@ public function hexToString(Request $request)
43
{
44
$hex = strtoupper($request->input('input'));
45
$hex = str_replace('\\X', '', $hex);
46
+ if (!preg_match("/^[A-Fa-f0-9]+$/", $hex)) {
47
+ return $this->out(1006);
48
+ }
49
$str = "";
50
for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
51
$str .= chr(hexdec($hex[$i].$hex[$i + 1]));
52
}
- return $this->out(200, ['output' => $str]);
53
+ if (preg_match('~[\x{4e00}-\x{9fa5}]+~u', $str, $tmp)) {
54
+ return $this->out(200, ['output' => (string)$str]);
55
56
+ return $this->out(4009);
57
58
+
59
0 commit comments