<?php
/**
* Experimental HTML5-based parser using Jeroen van der Meer's PH5P library.
* Occupies space in the HTML5 pseudo-namespace, which may cause conflicts.
*
* @note
* Recent changes to PHP's DOM extension have resulted in some fatal
* error conditions with the original version of PH5P. Pending changes,
* this lexer will punt to DirectLex if DOM throughs an exception.
*/
class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex {
public function tokenizeHTML($html, $config, $context) {
$new_html = $this->normalize($html, $config, $context);
$new_html = $this->wrapHTML($new_html, $config, $context);
try {
$parser = new HTML5($new_html);
$doc = $parser->save();
} catch (DOMException $e) {
// Uh oh, it failed. Punt to DirectLex.
$lexer = new HTMLPurifier_Lexer_DirectLex();
$context->register('PH5PError', $e); // save the error, so we can detect it
return $lexer->tokenizeHTML($html, $config, $context); // use original HTML
}
$tokens = array();
$this->tokenizeDOM(
$doc->getElementsByTagName('html')->item(0)-> // <html>
getElementsByTagName('body')->item(0)-> // <body>
getElementsByTagName('div')->item(0) // <div>
, $tokens);
return $tokens;
}
}
/*
Copyright 2007 Jeroen van der Meer <http://jero.net/>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
class HTML5 {
private $data;
private $char;
private $EOF;
private $state;
private $tree;
private $token;
private $content_model;
private $escape = false;
private $entities = array('AElig;','AElig','AMP;','AMP','Aacute;','Aacute',
'Acirc;','Acirc','Agrave;','Agrave','Alpha;','Aring;','Aring','Atilde;',
'Atilde','Auml;','Auml','Beta;','COPY;','COPY','Ccedil;','Ccedil','Chi;',
'Dagger;','Delta;','ETH;','ETH','Eacute;','Eacute','Ecirc;','Ecirc','Egrave;',
'Egrave','Epsilon;','Eta;','Euml;','Euml','GT;','GT','Gamma;','Iacute;',
'Iacute','Icirc;','Icirc','Igrave;','Igrave','Iota;','Iuml;','Iuml','Kappa;',
'LT;','LT','Lambda;','Mu;','Ntilde;','Ntilde','Nu;','OElig;','Oacute;',
'Oacute','Ocirc;','Ocirc','Ograve;','Ograve','Omega;','Omicron;','Oslash;',
'Oslash','Otilde;','Otilde','Ouml;','Ouml','Phi;','Pi;','Prime;','Psi;',
'QUOT;','QUOT','REG;','REG','Rho;','Scaron;','Sigma;','THORN;','THORN',
'TRADE;','Tau;','Theta;','Uacute;','Uacute','Ucirc;','Ucirc','Ugrave;',
'Ugrave','Upsilon;','Uuml;','Uuml','Xi;','Yacute;','Yacute','Yuml;','Zeta;',
'aacute;','aacute','acirc;','acirc','acute;','acute','aelig;','aelig',
'agrave;','agrave','alefsym;','alpha;','amp;','amp','and;','ang;','apos;',
'aring;','aring','asymp;','atilde;','atilde','auml;','auml','bdquo;','beta;',
'brvbar;','brvbar','bull;','cap;','ccedil;','ccedil','cedil;','cedil',
'cent;','cent','chi;','circ;','clubs;','cong;','copy;','copy','crarr;',
'cup;','curren;','curren','dArr;','dagger;','darr;','deg;','deg','delta;',
'diams;','divide;','divide','eacute;','eacute','ecirc;','ecirc','egrave;',
'egrave','empty;','emsp;','ensp;','epsilon;','equiv;','eta;','eth;','eth',
'euml;','euml','euro;','exist;','fnof;','forall;','frac12;','frac12',
'frac14;','frac14','frac34;','frac34','frasl;','gamma;','ge;','gt;','gt',
'hArr;','harr;','hearts;','hellip;','iacute;','iacute','icirc;','icirc',
'iexcl;','iexcl','igrave;','igrave','image;','infin;','int;','iota;',
'iquest;','iquest','isin;','iuml;','iuml','kappa;','lArr;','lambda;','lang;',
'laquo;','laquo','larr;','lceil;','ldquo;','le;','lfloor;','lowast;','loz;',
'lrm;','lsaquo;','lsquo;','lt;','lt','macr;','macr','mdash;','micro;','micro',
'middot;','middot','minus;','mu;','nabla;','nbsp;','nbsp','ndash;','ne;',
'ni;','not;','not','notin;','nsub;','ntilde;','ntilde','nu;','oacute;',
'oacute','ocirc;','ocirc','oelig;','ograve;','ograve','oline;','omega;',
'omicron;','oplus;','or;','ordf;','ordf','ordm;','ordm','oslash;','oslash',
'otilde;','otilde','otimes;','ouml;','ouml','para;','para','part;','permil;',
'perp;','phi;','pi;','piv;','plusmn;','plusmn','pound;','pound','prime;',
'prod;','prop;','psi;','quot;','quot','rArr;','radic;','rang;','raquo;',
'raquo','rarr;','rceil;','rdquo;','real;','reg;','reg','rfloor;','rho;',
'rlm;','rsaquo;','rsquo;','sbquo;','scaron;','sdot;','sect;','sect','shy;',
'shy','sigma;','sigmaf;','sim;','spades;','sub;','sube;','sum;','sup1;',
'sup1','sup2;','sup2','sup3;','sup3','sup;','supe;','szlig;','szlig','tau;',
'there4;','theta;','thetasym;','thinsp;','thorn;','thorn','tilde;','times;',
'times','trade;','uArr;','uacute;','uacute','uarr;','ucirc;','ucirc',
'ugrave;','ugrave','uml;','uml','upsih;','upsilon;','uuml;','uuml','weierp;',
'xi;','yacute;','yacute','yen;','yen','yuml;','yuml','zeta;','zwj;','zwnj;');
const PCDATA = 0;
const RCDATA = 1;
const CDATA = 2;
const PLAINTEXT = 3;
const DOCTYPE = 0;
const STARTTAG = 1;
const ENDTAG = 2;
const COMMENT = 3;
const CHARACTR = 4;
const EOF = 5;
public function __construct($data) {
$this->data = $data;
$this->char = -1;
$this->EOF = strlen($data);
$this->tree = new HTML5TreeConstructer;
$this->content_model = self::PCDATA;
$this->state = 'data';
while($this->state !== null) {
$this->{$this->state.'State'}();
}
}
public function save() {
return $this->tree->save();
}
private function char() {
return ($this->char < $this->EOF)
? $this->data[$this->char]
: false;
}
private function character($s, $l = 0) {
if($s + $l < $this->EOF) {
if($l === 0) {
return $this->data[$s];
} else {
return substr($this->data, $s, $l);
}
}
}
private function characters($char_class, $start) {
return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start));
}
private function dataState() {
// Consume the next input character
$this->char++;
$char = $this->char();
if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) {
/* U+0026 AMPERSAND (&)
When the content model flag is set to one of the PCDATA or RCDATA
states: switch to the entity data state. Otherwise: treat it as per
the "anything else" entry below. */
$this->state = 'entityData';
} elseif($char === '-') {
/* If the conten
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
易居房产系统(ejucms)是一套本地化O2O房产网站平台系统。通过系统用户快速找到自己合适的房源 房产代理公司主推自己的独家签售的楼盘,及展示公司合作销售的楼盘,快速获取潜在的意向客户报名,促进成交。 产品实现PC,手机数据同步,方便新房代理机构,租房公寓等互联网化扩张发展,帮助客户快速搭建类似于 海南品房阁,楼86,房多多,Q房网, 麦田房产,房天下,海外房产等网站平台。
资源推荐
资源详情
资源评论
收起资源包目录
EjuCMS-V2.4.0-UTF8-SP4.zip (3251个子文件)
Minipro.php.bak 47KB
App.php.bak 33KB
ThinkamAb.php.bak 17KB
Driver.php.bak 8KB
Minipro.php.bak 8KB
ThinkamAe.php.bak 2KB
ThinkhmMi.php.bak 1KB
ThinkamMi.php.bak 854B
Testing.php.bak 567B
test.bmp 0B
amazeui.min.css 291KB
amazeui.min.css 249KB
bootstrap.css 138KB
bootstrap.min.css 115KB
ask.css 94KB
ask.css 94KB
layui.css 85KB
main.css 81KB
reset.css 62KB
public.css 46KB
ueditor.css 44KB
aflist.css 44KB
font-awesome-ie7.min.css 37KB
ey_layui.css 35KB
ueditor.min.css 34KB
ey_layui.css 31KB
common.css 27KB
admin.css 26KB
admin.css 26KB
font-awesome.min.css 23KB
nhouse_index.css 22KB
font-awesome.min.css 22KB
video-js.css 21KB
jquery-ui.min.css 20KB
jquery-ui.min.css 20KB
image.css 19KB
swiper-3.4.2.min.css 17KB
swiper-3.4.2.min.css 17KB
public.css 17KB
style.css 16KB
video.css 15KB
ditu.css 15KB
attachment.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
eyoucms.css 14KB
eyoucms.css 14KB
home_always.css 13KB
template.css 12KB
template.css 12KB
video-js.min.css 11KB
iconfont.css 10KB
nhouse_info.css 10KB
mobile2.css 10KB
nhouse_dt.css 10KB
layui.mobile.css 10KB
lplist.css 9KB
shCoreBlue.css 9KB
colpick.css 9KB
shCoreDefault2.css 9KB
codemirror.css 8KB
iconfont.css 8KB
laydate.css 7KB
shCoreDefault.css 7KB
install.css 7KB
zTreeStyle.css 7KB
so_map.css 6KB
laydate.css 6KB
layer.css 6KB
layer.css 6KB
detail_dynamic_con.css 5KB
iconfont.css 5KB
layer.css 5KB
layer.css 5KB
layer.css 5KB
layer.css 5KB
layer.ext.css 5KB
layer.ext.css 5KB
tag_sand.css 4KB
scrawl.css 4KB
af_gd_right.css 4KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
kft_right.css 3KB
page.css 3KB
page.css 3KB
zixun.css 3KB
shapan.css 3KB
iframe.css 3KB
codemirror.css 3KB
af_gd.css 3KB
sx.css 3KB
zixun_con.css 3KB
login.css 3KB
login.css 3KB
共 3251 条
- 1
- 2
- 3
- 4
- 5
- 6
- 33
资源评论
- 鼎赞2020-10-31官方体验版还卖这么贵???浪费我C币啊!!!!后来人请谨慎
weixin_43547441
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功