Browse Source

improvements to UTF8 controller

tags/2.0.10
Carsten Brandt 8 years ago
parent
commit
578eb9259c
  1. 16
      build/controllers/Utf8Controller.php

16
build/controllers/Utf8Controller.php

@ -31,9 +31,13 @@ class Utf8Controller extends Controller
if ($directory === null) {
$directory = dirname(dirname(__DIR__)) . '/docs';
}
$files = FileHelper::findFiles($directory, [
'only' => ['*.md'],
]);
if (is_file($directory)) {
$files = [$directory];
} else {
$files = FileHelper::findFiles($directory, [
'only' => ['*.md'],
]);
}
foreach($files as $file) {
@ -63,11 +67,17 @@ class Utf8Controller extends Controller
|| 0x205f <= $ord && $ord <= 0x206F
) {
$this->found("UNSUPPORTED SPACE CHARACTER", $c, $line, $pos, $file);
continue;
}
if ($ord < 0x0020 && $ord != 0x000A && $ord != 0x0009 ||
0x0080 <= $ord && $ord < 0x009F) {
$this->found("CONTROL CHARARCTER", $c, $line, $pos, $file);
continue;
}
// if ($ord > 0x009F) {
// $this->found("NON ASCII CHARARCTER", $c, $line, $pos, $file);
// continue;
// }
}
}

Loading…
Cancel
Save