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