validate() && '' !== $this->value) // ? (\webfan\hps\Format\DataUri::create(\webfan\hps\Format\DataUri::DEFAULT_TYPE, $this->value, null) )->__toString() // : ''; return ((string)(''.$this->__toString())); } public function unserialize($data) { $this->value = $this->set($data); } /* abstract */ public function __toString() : string{ if(!$this->valid || $this->value === $this->typeError() ){ return ''; } return $this->value; } /* inherit */ protected function StrictTypeCheck(string $str) : string{ return $str; } /* abstract */ public function getStrictTypeCheck() :callable{ return [$this, 'StrictTypeCheck']; } /* abstract */ public function getType() : string { return 'base64'; } /* abstract */ public function getAliasNames() { return ['base64_encoded', 'b64']; } /* abstract */ protected function check($value) : bool{ return is_string($value) && $this->is_base64_chars($value) && $this->is_base64_string($value) && $this->is_base64_test($value) // No: Recursive Redundant && \webfan\hps\Format\Validate::isbase64($value) ; } public function is_base64_chars($str) { if (!preg_match('~[^0-9a-zA-Z+/=]~', $str)) { $check = str_split(base64_decode($str)); $x = 0; foreach ($check as $char) if (ord($char) > 126) $x++; if ($x/count($check)*100 < 30) return true; } return false; } public function is_base64_string($s) { // first check if we're dealing with an actual valid base64 encoded string if (($b = base64_decode($s, TRUE)) === FALSE) { return false; } // now check whether the decoded data could be actual text $e = mb_detect_encoding($b); if (in_array($e, array('UTF-8', 'ASCII'))) { // YMMV return true; } else { return false; } } public function is_base64_test($string){ $decoded = base64_decode($string, true); // Check if there is no invalid character in string if (!preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string)) return false; // Decode the string in strict mode and send the response if (!base64_decode($string, true)) return false; // Encode and compare it to original one if (base64_encode($decoded) != $string) return false; return true; } } __halt_compiler();----SIGNATURE:----ArzEYd65isKa7jaQCb+1Z369GLx7u94JiwJHLDBsA7NEOomlJT5OVkEZooijZGWVZhHRQN51NGYFRO1RIkSOgGMOsxr4Si1CCmf+3y0YwUZVFVoAYt7fnp0aye9nuC77zF75Qt08IUx/hRA/m9RqHk9GUGidky4HCiXLMotV99rpIndBDRTTRlFeqdOsg4mvUSFGs8tsYv5hoVcKE3M91G9jLFldhnqLevsWXfOd8phdBfq/Mc4hjBcSfvopJFs/yaQeoe6poim28V25/Jkp5we16tL7xT33UBdL54VFRzTY8ZsZk8AIKW7C6MnpBkpE0eN/NfQegEO4vB53HvK1ab2aQExnKV4u+rEwiFhI4P6aTkt2cQYsOb31PDRL3+hZqaniOkZMhE8FWgUGoaxzDJyiwMoeF8V4JVkEikUNtIJDlhAKbQo+Do2Vzz1lfCJYLjiYMMoBh3dtBqLY4kFTRmoLUCuGgbuNdyqHDB8YFom92AWFSGN1tJF5SOAB6EfpIvadVe4MMkmo3NhdFCp+77jNTbIdqQngtXvAAG6zZ6LFPyzPKIRx+pjWgFvlwmQGhvqS9lny42L8UUhVj2U7T6YpeTSXJS2i7OY3rEAla7WSx6J/3MohD19TfELfMm+gne+t50R+6XhMvvCe0Ugnc+27NWqQAnyoL/G0MQ1yHl0=----ATTACHMENT:----NzU5ODE2Mjc3ODQ5NjI1OCA4OTUyOTEwMzA0NTgyNDcgNDgyMjUzMzczMjE5NDkxNw==