Browse Source

fix: low case compare on punycode

master
Dnomd343 3 years ago
parent
commit
47afd58f77
  1. 2
      lib/Punycode.php
  2. 2
      models/punycode.php

2
lib/Punycode.php

@ -87,7 +87,7 @@ class Punycode {
$length = strlen($output); $length = strlen($output);
if ($length > 255) { if ($length > 255) {
$this->errFlag = true; $this->errFlag = true;
$this->errMsg = 'A full domain name is limited to 255 octets (including the separators), ' . $length . 'given.'; $this->errMsg = 'A full domain name is limited to 255 octets (including the separators), ' . $length . ' given.';
} }
return $output; return $output;

2
models/punycode.php

@ -29,7 +29,7 @@ class punycodeEntry {
public function query($rawParam) { // Punycode转换查询入口 public function query($rawParam) { // Punycode转换查询入口
$encode = $this->encode($rawParam); $encode = $this->encode($rawParam);
$decode = $this->decode($rawParam); $decode = $this->decode($rawParam);
if ($decode['data'] === $rawParam) { // 输入为明文 if ($decode['data'] === strtolower($rawParam)) { // 输入为明文
$msg = '`' . $encode['data'] . '`' . PHP_EOL; $msg = '`' . $encode['data'] . '`' . PHP_EOL;
if ($encode['status'] !== 'ok') { if ($encode['status'] !== 'ok') {
$errMsg = $encode['message']; $errMsg = $encode['message'];

Loading…
Cancel
Save