public function headers() { $_SERVER = Helpers::htmlentitiesArray($_SERVER, true); foreach ($_SERVER as $key => $value) { $this->headers[$key] = $value; } }
public function testHtmlSpecialChars() { $singlestring = '<>&'; $singlestringAnswer = '<>&'; $array = ['<>&', 'key<' => ['<>&', 'key<' => '<>&']]; $arrayAnswersDoKeysTrue = ['<>&', 'key<' => ['<>&', 'key<' => '<>&']]; $arrayAnswersDoKeysFalse = ['<>&', 'key<' => ['<>&', 'key<' => '<>&']]; $this->assertEquals($singlestringAnswer, \RESTWork\Helpers::htmlspecialchars($singlestring)); $this->assertEquals($arrayAnswersDoKeysFalse, \RESTWork\Helpers::htmlspecialcharsArray($array, false)); $this->assertEquals($arrayAnswersDoKeysTrue, \RESTWork\Helpers::htmlspecialcharsArray($array, true)); }