| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function HiddenEmailAddress() |
||
| 15 | { |
||
| 16 | $originalString = $this->value; |
||
| 17 | $encodedString = ''; |
||
| 18 | $nowCodeString = ''; |
||
| 19 | $originalLength = strlen($this->value); |
||
| 20 | for ($i = 0; $i < $originalLength; ++$i) { |
||
| 21 | $encodeMode = rand(1, 2); // Switch encoding odd/even |
||
| 22 | switch ($encodeMode) { |
||
| 23 | case 1: // Decimal code |
||
| 24 | $nowCodeString = '&#'.ord($originalString[$i]).';'; |
||
| 25 | break; |
||
| 26 | case 2: // Hexadecimal code |
||
| 27 | $nowCodeString = '&#x'.dechex(ord($originalString[$i])).';'; |
||
| 28 | break; |
||
| 29 | default: |
||
| 30 | return 'ERROR: wrong encoding mode.'; |
||
| 31 | } |
||
| 32 | $encodedString .= $nowCodeString; |
||
| 33 | } |
||
| 34 | |||
| 35 | return $encodedString; |
||
| 36 | } |
||
| 37 | |||
| 61 |