CdataStrategy.php
8 years ago
CdataStrategyAlways.php
8 years ago
CdataStrategyFactory.php
9 years ago
CdataStrategyIllegalCharacters.php
8 years ago
CdataStrategyIllegalCharactersHtmlEntities.php
8 years ago
CdataStrategyNever.php
8 years ago
XMLWriter.php
8 years ago
chunk.php
5 years ago
config.php
7 years ago
download.php
6 years ago
handler.php
10 years ago
helper.php
12 years ago
input.php
7 years ago
installer.php
9 years ago
session.php
10 years ago
wpallimport.php
4 years ago
zip.php
10 years ago
CdataStrategyIllegalCharacters.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | require_once('CdataStrategy.php'); |
| 4 | |
| 5 | class CdataStrategyIllegalCharacters implements CdataStrategy |
| 6 | { |
| 7 | private $illegalCharacters = array('<','>','&', '\'', '"','**LT**', '**GT**'); |
| 8 | |
| 9 | public function should_cdata_be_applied($field, $hasSnippets = false) |
| 10 | { |
| 11 | if($hasSnippets) { |
| 12 | $this->illegalCharacters = array('<','>','&', '**LT**', '**GT**'); |
| 13 | } |
| 14 | |
| 15 | foreach($this->illegalCharacters as $character) { |
| 16 | if(strpos($field, $character) !== false) { |
| 17 | return true; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | } |