| Server IP : 178.212.43.201 / Your IP : 10.100.0.33 Web Server : Apache/2.4.37 (Oracle Linux Server) OpenSSL/1.1.1k System : Linux spa0007.srv.paxillus.pl 5.4.17-2136.355.3.1.el8uek.x86_64 #3 SMP Sat May 9 17:11:55 PDT 2026 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/suzuki/wp-content/plugins/amp/includes/sanitizers/ |
Upload File : |
<?php
/**
* Class AMP_Dev_Mode_Sanitizer
*
* Add the data-ampdevmode to the document element and to the elements specified by the supplied args.
*
* @since 1.3
* @package AMP
*/
/**
* Class AMP_Dev_Mode_Sanitizer
*
* @since 1.3
* @internal
*/
final class AMP_Dev_Mode_Sanitizer extends AMP_Base_Sanitizer {
/**
* Array of flags used to control sanitization.
*
* @var array {
* @type string[] $element_xpaths XPath expressions for elements to add the data-ampdevmode attribute to.
* }
*/
protected $args;
/**
* Sanitize document for dev mode.
*
* @since 1.3
*/
public function sanitize() {
$this->dom->documentElement->setAttribute( AMP_Rule_Spec::DEV_MODE_ATTRIBUTE, '' );
$element_xpaths = ! empty( $this->args['element_xpaths'] ) ? $this->args['element_xpaths'] : [];
foreach ( $element_xpaths as $element_xpath ) {
foreach ( $this->dom->xpath->query( $element_xpath ) as $node ) {
if ( $node instanceof DOMElement ) {
$node->setAttribute( AMP_Rule_Spec::DEV_MODE_ATTRIBUTE, '' );
}
}
}
}
}