该仓库已于 2022-06-23 归档。您可以查看文件或克隆它,但不能推送、创建工单或合并请求。
文件
divi/core/components/data/ScriptReplacer.php
2021-12-07 11:08:05 +00:00

25 行
395 B
PHP

<?php
/**
* Utility class for replacing scripts in a string.
*
* @since 3.18.5
*
* @package ET\Core\Data
*/
class ET_Core_Data_ScriptReplacer {
private $_map = array();
public function replace( $matches ) {
$script = $matches[0];
$id = md5( $script );
$this->_map[ $id ] = $script;
return $id;
}
public function map() {
return $this->_map;
}
}