partner-discount-sdk
1 month ago
CdataStrategy.php
1 month ago
CdataStrategyAlways.php
1 month ago
CdataStrategyFactory.php
1 month ago
CdataStrategyIllegalCharacters.php
1 month ago
CdataStrategyIllegalCharactersHtmlEntities.php
1 month ago
CdataStrategyNever.php
1 month ago
XMLWriter.php
1 month ago
chunk.php
1 month ago
config.php
3 years ago
download.php
1 month ago
handler.php
1 month ago
helper.php
1 month ago
input.php
1 month ago
installer.php
1 month ago
session.php
10 years ago
wpallimport.php
1 month ago
zip.php
4 years ago
CdataStrategyIllegalCharacters.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- legitimate plugin prefixes (pmxe/PMXE/wpae/Wpae/wp_all_export/wpallexport/XmlExport/CdataStrategy/VariableProductTitle/Soflyy/GF_Export); Plugin Check does not honor phpcs.xml prefix declaration |
| 4 | require_once('CdataStrategy.php'); |
| 5 | |
| 6 | class CdataStrategyIllegalCharacters implements CdataStrategy |
| 7 | { |
| 8 | private $illegalCharacters = array('<','>','&', '\'', '"','**LT**', '**GT**'); |
| 9 | |
| 10 | public function should_cdata_be_applied($field, $hasSnippets = false) |
| 11 | { |
| 12 | if(empty($field)){ |
| 13 | return false; |
| 14 | } |
| 15 | |
| 16 | if($hasSnippets) { |
| 17 | $this->illegalCharacters = array('<','>','&', '**LT**', '**GT**'); |
| 18 | } |
| 19 | |
| 20 | foreach($this->illegalCharacters as $character) { |
| 21 | if(strpos($field, $character) !== false) { |
| 22 | return true; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | } |