ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
FilenameSanitizing.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\Filesystem\Util;
20 
23 
24 require_once("./include/Unicode/UtfNormal.php");
25 
30 {
31  public function provideFilenames() : array
32  {
33  return [
34  ["Control\u{00a0}Character", 'ControlCharacter'],
35  ["Soft\u{00ad}Hyphen", 'SoftHyphen'],
36  ["No\u{0083}Break", 'NoBreak'],
37  ["ZeroWidth\u{200C}NonJoiner", 'ZeroWidthNonJoiner'],
38  ["ZeroWidth\u{200d}Joiner", 'ZeroWidthJoiner'],
39  ["Invisible\u{2062}Times", 'InvisibleTimes'],
40  ["Invisible\u{2063}Comma", 'InvisibleComma'],
41  ["Funky\u{200B}Whitespace", 'FunkyWhitespace'],
42  ];
43  }
44 
48  public function testSanitize(string $filename, string $expected) : void
49  {
50  $this->assertEquals($expected, Util::sanitizeFilename($filename));
51  }
52 }
testSanitize(string $filename, string $expected)
provideFilenames
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$filename
Definition: buildRTE.php:89