[^<]*)'; protected $params = array(); protected function loadXML($xml) { $this->checkUnsupported($xml); $flags = (\LIBXML_VERSION >= 20700) ? \LIBXML_COMPACT | \LIBXML_PARSEHUGE : 0; $dom = new DOMDocument; $dom->loadXML($xml, $flags); return $dom; } public function render($xml) { if (\substr($xml, 0, 3) === '') return $this->renderPlainText($xml); else return $this->renderRichText(\preg_replace($this->metaElementsRegexp, '', $xml)); } protected function renderPlainText($xml) { $html = \substr($xml, 3, -4); $html = \str_replace('
', '
', $html); $html = $this->decodeSMP($html); return $html; } abstract protected function renderRichText($xml); public function getParameter($paramName) { return (isset($this->params[$paramName])) ? $this->params[$paramName] : ''; } public function getParameters() { return $this->params; } public function setParameter($paramName, $paramValue) { $this->params[$paramName] = (string) $paramValue; } public function setParameters(array $params) { foreach ($params as $paramName => $paramValue) $this->setParameter($paramName, $paramValue); } protected function checkUnsupported($xml) { if (\strpos($xml, ''','AMAZON_ASSOCIATE_TAG_CA'=>'','AMAZON_ASSOCIATE_TAG_DE'=>'','AMAZON_ASSOCIATE_TAG_ES'=>'','AMAZON_ASSOCIATE_TAG_FR'=>'','AMAZON_ASSOCIATE_TAG_IT'=>'','AMAZON_ASSOCIATE_TAG_JP'=>'','AMAZON_ASSOCIATE_TAG_UK'=>''); protected static $tagBranches=array('ABCNEWS'=>0,'AMAZON'=>1,'AUDIOBOOM'=>2,'AUDIOMACK'=>3,'BANDCAMP'=>4,'BBCNEWS'=>5,'BLAB'=>6,'BLEACHERREPORT'=>7,'BREAK'=>8,'BRIGHTCOVE'=>9,'CBSNEWS'=>10,'CNBC'=>11,'CNN'=>12,'CNNMONEY'=>13,'COLLEGEHUMOR'=>14,'COMEDYCENTRAL'=>15,'COUB'=>16,'DAILYMOTION'=>17,'DEMOCRACYNOW'=>18,'DUMPERT'=>19,'EIGHTTRACKS'=>20,'ESPN'=>21,'FACEBOOK'=>22,'FLICKR'=>23,'FORATV'=>24,'FOXNEWS'=>25,'FUNNYORDIE'=>26,'GAMESPOT'=>27,'GAMETRAILERS'=>28,'GETTY'=>29,'GFYCAT'=>30,'GIFS'=>31,'GIST'=>32,'GLOBALNEWS'=>33,'GOFUNDME'=>34,'GOOGLEDRIVE'=>35,'GOOGLEPLUS'=>36,'GOOGLESHEETS'=>37,'HEALTHGURU'=>38,'HUDL'=>39,'HULU'=>40,'HUMORTVNL'=>41,'IGN'=>42,'IMDB'=>43,'IMGUR'=>44,'INDIEGOGO'=>45,'INSTAGRAM'=>46,'INTERNETARCHIVE'=>47,'IZLESENE'=>48,'JWPLATFORM'=>49,'KHL'=>50,'KICKSTARTER'=>51,'KISSVIDEO'=>52,'LIBSYN'=>53,'LIVECAP'=>54,'LIVELEAK'=>55,'LIVESTREAM'=>56,'MAILRU'=>57,'MEDIUM'=>58,'METACAFE'=>59,'MIXCLOUD'=>60,'MLB'=>61,'MRCTV'=>62,'MSNBC'=>63,'NATGEOCHANNEL'=>64,'NATGEOVIDEO'=>65,'NBCNEWS'=>66,'NBCSPORTS'=>67,'NHL'=>68,'NPR'=>69,'NYTIMES'=>70,'ODDSHOT'=>71,'PASTEBIN'=>72,'PINTEREST'=>73,'PLAYSTV'=>74,'PODBEAN'=>75,'PREZI'=>76,'REDDIT'=>77,'RUTUBE'=>78,'SCRIBD'=>79,'SLIDESHARE'=>80,'SOUNDCLOUD'=>81,'SPORTSNET'=>82,'SPOTIFY'=>83,'STEAMSTORE'=>84,'STITCHER'=>85,'STRAWPOLL'=>86,'STREAMABLE'=>87,'TEAMCOCO'=>88,'TED'=>89,'THEATLANTIC'=>90,'THEGUARDIAN'=>91,'THEONION'=>92,'TINYPIC'=>93,'TMZ'=>94,'TRAILERADDICT'=>95,'TUMBLR'=>96,'TWITCH'=>97,'TWITTER'=>98,'USTREAM'=>99,'VBOX7'=>100,'VEOH'=>101,'VEVO'=>102,'VIAGAME'=>103,'VIDEODETECTIVE'=>104,'VIDEOMEGA'=>105,'VIDME'=>106,'VIMEO'=>107,'VINE'=>108,'VK'=>109,'VOCAROO'=>110,'VOX'=>111,'WASHINGTONPOST'=>112,'WSHH'=>113,'WSJ'=>114,'XBOXCLIPS'=>115,'XBOXDVR'=>116,'YAHOOSCREEN'=>117,'YOUKU'=>118,'YOUTUBE'=>119,'ZIPPYSHARE'=>120,'br'=>121,'e'=>122,'i'=>122,'s'=>122,'p'=>123); public function __sleep() { $props = \get_object_vars($this); unset($props['out'], $props['proc'], $props['source']); return \array_keys($props); } public function renderRichText($xml) { if (!isset($this->quickRenderingTest) || !\preg_match($this->quickRenderingTest, $xml)) try { return $this->renderQuick($xml); } catch (\Exception $e) { } $dom = $this->loadXML($xml); $this->out = ''; $this->at($dom->documentElement); return $this->out; } protected function at(\DOMNode $root) { if ($root->nodeType === 3) $this->out .= \htmlspecialchars($root->textContent,0); else foreach ($root->childNodes as $node) if (!isset(self::$tagBranches[$node->nodeName])) $this->at($node); else { $tb = self::$tagBranches[$node->nodeName]; if($tb<62)if($tb<31){if($tb<16)if($tb<8)if($tb<4)if($tb===0)$this->out.='
';elseif($tb===1){$this->out.='
';}elseif($tb===2)$this->out.='';elseif($node->getAttribute('mode')==='album')$this->out.='';else$this->out.='';elseif($tb===4){$this->out.='
';}elseif($tb===5){$this->out.='
';}elseif($tb===6)$this->out.='
';else$this->out.='
';elseif($tb<12)if($tb===8)$this->out.='
';elseif($tb===9)$this->out.='
';elseif($tb===10){$this->out.='
';if($node->hasAttribute('pid'))$this->out.='
';$this->out.='';}else$this->out.='
';elseif($tb===12)$this->out.='
';elseif($tb===13)$this->out.='
';elseif($tb===14)$this->out.='
';else$this->out.='
';elseif($tb<24)if($tb<20)if($tb===16)$this->out.='
';elseif($tb===17)$this->out.='
';elseif($tb===18){$this->out.='
';}else$this->out.='
';elseif($tb===20)$this->out.='
';elseif($tb===21)$this->out.='
';elseif($tb===22)$this->out.='';else$this->out.='
';elseif($tb<28)if($tb===24)$this->out.='
';elseif($tb===25)$this->out.='
';elseif($tb===26)$this->out.='
';else$this->out.='
';elseif($tb===28){$this->out.='
';}elseif($tb===29){$this->out.='
';}else{$this->out.='
';}}elseif($tb<47)if($tb<39)if($tb<35)if($tb===31){$this->out.='
';}elseif($tb===32)$this->out.='';elseif($tb===33)$this->out.='
';else$this->out.='
';elseif($tb===35)$this->out.='
';elseif($tb===36){$this->out.='';}elseif($tb===37)$this->out.='';else$this->out.='
';elseif($tb<43)if($tb===39)$this->out.='
';elseif($tb===40)$this->out.='
';elseif($tb===41)$this->out.='
';else$this->out.='
';elseif($tb===43)$this->out.='
';elseif($tb===44){$this->out.='';}elseif($tb===45)$this->out.='
';else$this->out.='';elseif($tb<55)if($tb<51)if($tb===47){$this->out.='
';}elseif($tb===48)$this->out.='
';elseif($tb===49)$this->out.='
';else$this->out.='
';elseif($tb===51)if($node->hasAttribute('video'))$this->out.='
';else$this->out.='
';elseif($tb===52)$this->out.='
';elseif($tb===53)$this->out.='';else$this->out.='
';elseif($tb<59)if($tb===55)$this->out.='
';elseif($tb===56){$this->out.='
';}elseif($tb===57)$this->out.='
';else$this->out.='';elseif($tb===59)$this->out.='
';elseif($tb===60)$this->out.='
';else$this->out.='
';elseif($tb<93)if($tb<78)if($tb<70)if($tb<66)if($tb===62)$this->out.='
';elseif($tb===63)$this->out.='
';elseif($tb===64)$this->out.='
';else$this->out.='
';elseif($tb===66)$this->out.='
';elseif($tb===67)$this->out.='
';elseif($tb===68){$this->out.='
';}else$this->out.='';elseif($tb<74)if($tb===70)$this->out.='
';elseif($tb===71)$this->out.='
';elseif($tb===72)$this->out.='';else{$this->out.='';}elseif($tb===74)$this->out.='
';elseif($tb===75)$this->out.='';elseif($tb===76)$this->out.='
';else$this->out.='';elseif($tb<86)if($tb<82)if($tb===78)$this->out.='
';elseif($tb===79)$this->out.='';elseif($tb===80)$this->out.='
';else{$this->out.='';}elseif($tb===82)$this->out.='
';elseif($tb===83){$this->out.='
';}elseif($tb===84)$this->out.='';else$this->out.='';elseif($tb<90){if($tb===86)$this->out.='
';elseif($tb===87)$this->out.='
';elseif($tb===88)$this->out.='
';else{$this->out.='
';}}elseif($tb===90)$this->out.='
';elseif($tb===91)$this->out.='
';else$this->out.='
';elseif($tb<109)if($tb<101)if($tb<97)if($tb===93)$this->out.='
';elseif($tb===94)$this->out.='
';elseif($tb===95)$this->out.='
';else$this->out.='';elseif($tb===97){$this->out.='
';}elseif($tb===98)$this->out.='';elseif($tb===99){$this->out.='
';if($node->hasAttribute('vid'))$this->out.='';$this->out.='
';}else$this->out.='
';elseif($tb<105)if($tb===101)$this->out.='
';elseif($tb===102)$this->out.='
';elseif($tb===103)$this->out.='
';else$this->out.='
';elseif($tb===105)$this->out.='
';elseif($tb===106){$this->out.='
';}elseif($tb===107)$this->out.='
';else$this->out.='
';elseif($tb<117)if($tb<113)if($tb===109)$this->out.='
';elseif($tb===110)$this->out.='
';elseif($tb===111)$this->out.='
';else$this->out.='
';elseif($tb===113)$this->out.='
';elseif($tb===114)$this->out.='
';elseif($tb===115)$this->out.='
';else$this->out.='
';elseif($tb<121)if($tb===117)$this->out.='
';elseif($tb===118)$this->out.='
';elseif($tb===119){$this->out.='
';}else$this->out.='';elseif($tb===121)$this->out.='
';elseif($tb===122);else{$this->out.='

';$this->at($node);$this->out.='

';} } } private static $dynamic=array('ABCNEWS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'AUDIOBOOM'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'BLAB'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'BLEACHERREPORT'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'BREAK'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'BRIGHTCOVE'=>array('(^[^ ]+(?> (?!bc(?>key|pid|tid)=)[^=]+="[^"]*")*(?> bckey="([^"]*)")?(?> (?!bc[pt]id=)[^=]+="[^"]*")*(?> bcpid="([^"]*)")?(?> (?!bctid=)[^=]+="[^"]*")*(?> bctid="([^"]*)")?.*)s','
'),'CNBC'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'CNN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'CNNMONEY'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'COLLEGEHUMOR'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'COMEDYCENTRAL'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'COUB'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'DAILYMOTION'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'EIGHTTRACKS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'ESPN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'FLICKR'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'FORATV'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'FOXNEWS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'FUNNYORDIE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'GAMESPOT'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'GIST'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'GLOBALNEWS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'GOFUNDME'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'GOOGLEDRIVE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'GOOGLESHEETS'=>array('(^[^ ]+(?> (?!g?id=)[^=]+="[^"]*")*(?> gid="([^"]*)")?(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'HEALTHGURU'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'HUDL'=>array('(^[^ ]+(?> (?!(?>athlete|highlight)=)[^=]+="[^"]*")*(?> athlete="([^"]*)")?(?> (?!highlight=)[^=]+="[^"]*")*(?> highlight="([^"]*)")?.*)s','
'),'HULU'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'HUMORTVNL'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'IGN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'IMDB'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'INDIEGOGO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'INSTAGRAM'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'IZLESENE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'JWPLATFORM'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'KHL'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'KISSVIDEO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'LIBSYN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'LIVECAP'=>array('(^[^ ]+(?> (?!(?>channel|id)=)[^=]+="[^"]*")*(?> channel="([^"]*)")?(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'LIVELEAK'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'MAILRU'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'METACAFE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'MIXCLOUD'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'MLB'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'MRCTV'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'MSNBC'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'NATGEOCHANNEL'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'NATGEOVIDEO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'NBCNEWS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'NBCSPORTS'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'NPR'=>array('(^[^ ]+(?> (?![im]=)[^=]+="[^"]*")*(?> i="([^"]*)")?(?> (?!m=)[^=]+="[^"]*")*(?> m="([^"]*)")?.*)s',''),'NYTIMES'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'ODDSHOT'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'PASTEBIN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'PLAYSTV'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'PODBEAN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'PREZI'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'REDDIT'=>array('(^[^ ]+(?> (?!path=)[^=]+="[^"]*")*(?> path="([^"]*)")?.*)s',''),'RUTUBE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'SCRIBD'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'SLIDESHARE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'SPORTSNET'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'STEAMSTORE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'STITCHER'=>array('(^[^ ]+(?> (?![ef]id=)[^=]+="[^"]*")*(?> eid="([^"]*)")?(?> (?!fid=)[^=]+="[^"]*")*(?> fid="([^"]*)")?.*)s',''),'STRAWPOLL'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'STREAMABLE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'TEAMCOCO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'THEATLANTIC'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'THEGUARDIAN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'THEONION'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'TINYPIC'=>array('(^[^ ]+(?> (?!(?>s|id)=)[^=]+="[^"]*")*(?> id="([^"]*)")?(?> (?!s=)[^=]+="[^"]*")*(?> s="([^"]*)")?.*)s','
'),'TMZ'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'TRAILERADDICT'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'TUMBLR'=>array('(^[^ ]+(?> (?!(?>id|key)=)[^=]+="[^"]*")*(?> id="([^"]*)")?(?> (?!key=)[^=]+="[^"]*")*(?> key="([^"]*)")?.*)s',''),'TWITTER'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s',''),'VBOX7'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VEOH'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VEVO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VIAGAME'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VIDEODETECTIVE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VIDEOMEGA'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VIMEO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VINE'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VK'=>array('(^[^ ]+(?> (?!(?>hash|oid|vid)=)[^=]+="[^"]*")*(?> hash="([^"]*)")?(?> (?![ov]id=)[^=]+="[^"]*")*(?> oid="([^"]*)")?(?> (?!vid=)[^=]+="[^"]*")*(?> vid="([^"]*)")?.*)s','
'),'VOCAROO'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'VOX'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'WASHINGTONPOST'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'WSHH'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'WSJ'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'XBOXCLIPS'=>array('(^[^ ]+(?> (?!(?>id|user)=)[^=]+="[^"]*")*(?> id="([^"]*)")?(?> (?!user=)[^=]+="[^"]*")*(?> user="([^"]*)")?.*)s','
'),'XBOXDVR'=>array('(^[^ ]+(?> (?!(?>id|user)=)[^=]+="[^"]*")*(?> id="([^"]*)")?(?> (?!user=)[^=]+="[^"]*")*(?> user="([^"]*)")?.*)s','
'),'YAHOOSCREEN'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'YOUKU'=>array('(^[^ ]+(?> (?!id=)[^=]+="[^"]*")*(?> id="([^"]*)")?.*)s','
'),'ZIPPYSHARE'=>array('(^[^ ]+(?> (?!(?>file|server)=)[^=]+="[^"]*")*(?> file="([^"]*)")?(?> (?!server=)[^=]+="[^"]*")*(?> server="([^"]*)")?.*)s','')); private static $attributes; private static $quickBranches=array('AMAZON'=>0,'AUDIOMACK'=>1,'BANDCAMP'=>2,'BBCNEWS'=>3,'CBSNEWS'=>4,'DEMOCRACYNOW'=>5,'DUMPERT'=>6,'FACEBOOK'=>7,'GAMETRAILERS'=>8,'GETTY'=>9,'GFYCAT'=>10,'GIFS'=>11,'GOOGLEPLUS'=>12,'IMGUR'=>13,'INTERNETARCHIVE'=>14,'KICKSTARTER'=>15,'LIVESTREAM'=>16,'MEDIUM'=>17,'NHL'=>18,'PINTEREST'=>19,'SOUNDCLOUD'=>20,'SPOTIFY'=>21,'TED'=>22,'TWITCH'=>23,'USTREAM'=>24,'VIDME'=>25,'YOUTUBE'=>26); protected function renderQuick($xml) { $xml = $this->decodeSMP($xml); self::$attributes = array(); $html = \preg_replace_callback( '(<(?:(?!/)((?:A(?>BCNEWS|MAZON|UDIO(?>BOOM|MACK))|B(?>ANDCAMP|BCNEWS|L(?>AB|EACHERREPORT)|R(?>EAK|IGHTCOVE))|C(?:BSNEWS|N(?:BC|N(?>MONEY)?)|O(?>LLEGEHUMOR|MEDYCENTRAL|UB))|D(?>AILYMOTION|EMOCRACYNOW|UMPERT)|E(?>IGHTTRACKS|SPN)|F(?>ACEBOOK|LICKR|O(?>RATV|XNEWS)|UNNYORDIE)|G(?>AME(?>SPOT|TRAILERS)|ETTY|FYCAT|I(?>FS|ST)|LOBALNEWS|O(?>FUNDME|OGLE(?>DRIVE|PLUS|SHEETS)))|H(?>EALTHGURU|U(?>DL|LU|MORTVNL))|I(?>GN|M(?>DB|GUR)|N(?>DIEGOGO|STAGRAM|TERNETARCHIVE)|ZLESENE)|JWPLATFORM|K(?>HL|I(?>CKSTARTER|SSVIDEO))|LI(?>BSYN|VE(?>CAP|LEAK|STREAM))|M(?>AILRU|E(?>DIUM|TACAFE)|IXCLOUD|LB|RCTV|SNBC)|N(?>ATGEO(?>CHANNEL|VIDEO)|BC(?>NEW|SPORT)S|HL|PR|YTIMES)|ODDSHOT|P(?>ASTEBIN|INTEREST|LAYSTV|ODBEAN|REZI)|R(?>EDDIT|UTUBE)|S(?>CRIBD|LIDESHARE|OUNDCLOUD|PO(?>RTSNET|TIFY)|T(?>EAMSTORE|ITCHER|R(?>AWPOLL|EAMABLE)))|T(?>E(?>D|AMCOCO)|HE(?>ATLANTIC|GUARDIAN|ONION)|INYPIC|MZ|RAILERADDICT|UMBLR|WIT(?>CH|TER))|USTREAM|V(?>K|BOX7|E(?>OH|VO)|I(?>AGAME|D(?>EO(?>DETECTIVE|MEGA)|ME)|MEO|NE)|O(?>X|CAROO))|W(?>ASHINGTONPOST|S(?>J|HH))|XBOX(?>CLIPS|DVR)|Y(?>AHOOSCREEN|OU(?>KU|TUBE))|ZIPPYSHARE))(?: [^>]*)?>.*?)[^ />]+)[^>]*?(/)?)>)s', array($this, 'quick'), \preg_replace( '(<[eis]>[^<]*)', '', \substr($xml, 1 + \strpos($xml, '>'), -4) ) ); return \str_replace('
', '
', $html); } protected function quick($m) { if (isset($m[2])) { $id = $m[2]; if (isset($m[3])) { unset($m[3]); $m[0] = \substr($m[0], 0, -2) . '>'; $html = $this->quick($m); $m[0] = ''; $m[2] = '/' . $id; $html .= $this->quick($m); return $html; } } else { $id = $m[1]; $lpos = 1 + \strpos($m[0], '>'); $rpos = \strrpos($m[0], '<'); $textContent = \substr($m[0], $lpos, $rpos - $lpos); if (\strpos($textContent, '<') !== \false) throw new \RuntimeException; $textContent = \htmlspecialchars_decode($textContent); } if (isset(self::$dynamic[$id])) { list($match, $replace) = self::$dynamic[$id]; return \preg_replace($match, $replace, $m[0], 1); } if (!isset(self::$quickBranches[$id])) { if ($id[0] === '!' || $id[0] === '?') throw new \RuntimeException; return ''; } $attributes = array(); if (\strpos($m[0], '="') !== \false) { \preg_match_all('(([^ =]++)="([^"]*))S', \substr($m[0], 0, \strpos($m[0], '>')), $matches); foreach ($matches[1] as $i => $attrName) $attributes[$attrName] = $matches[2][$i]; } $qb = self::$quickBranches[$id]; if($qb<14){if($qb<7)if($qb<4)if($qb===0){$attributes+=array('tld'=>\null,'id'=>\null);$html='
';}elseif($qb===1){$attributes+=array('mode'=>\null,'id'=>\null);$html='';if($attributes['mode']==='album')$html.='';else$html.='';}elseif($qb===2){$attributes+=array('track_num'=>\null,'track_id'=>\null);$html='
';}else{$attributes+=array('playlist'=>\null,'id'=>\null);$html='
';}elseif($qb===4){$attributes+=array('id'=>\null);$html='
';if(isset($attributes['pid']))$html.='
';$html.='';}elseif($qb===5){$attributes+=array('id'=>\null);$html='
';}else{$attributes+=array('id'=>\null);$html='
';}elseif($qb<11)if($qb===7){$attributes+=array('type'=>\null,'id'=>\null);$html='';}elseif($qb===8){$attributes+=array('id'=>\null);$html='
';}elseif($qb===9){$attributes+=array('width'=>\null,'height'=>\null,'id'=>\null,'et'=>\null,'sig'=>\null);$html='
';}else{$attributes+=array('width'=>\null,'height'=>\null,'id'=>\null);$html='
';}elseif($qb===11){$attributes+=array('width'=>\null,'height'=>\null,'id'=>\null);$html='
';}elseif($qb===12){$attributes+=array('name'=>\null,'pid'=>\null);$html='';}else{$attributes+=array('type'=>\null,'id'=>\null);$html='';}}elseif($qb<21)if($qb<18)if($qb===14){$attributes+=array('width'=>\null,'height'=>\null,'id'=>\null);$html='
';}elseif($qb===15){$attributes+=array('id'=>\null);$html='';if(isset($attributes['video']))$html.='
';else$html.='
';}elseif($qb===16){$attributes+=array('channel'=>\null,'account_id'=>\null,'event_id'=>\null);$html='
';}else{$attributes+=array('id'=>\null);$html='';}elseif($qb===18){$attributes+=array('t'=>\null,'id'=>\null);$html='
';}elseif($qb===19){$attributes+=array('id'=>\null);$html='';}else{$attributes+=array('secret_token'=>\null,'id'=>\null);$html='';}elseif($qb<24)if($qb===21){$attributes+=array('path'=>\null);$html='
';}elseif($qb===22){$attributes+=array('id'=>\null);$html='
';}else{$attributes+=array('channel'=>\null,'clip_id'=>\null);$html='
';}elseif($qb===24){$attributes+=array('cid'=>\null);$html='
';if(isset($attributes['vid']))$html.='';$html.='
';}elseif($qb===25){$attributes+=array('width'=>\null,'height'=>\null,'id'=>\null);$html='
';}else{$attributes+=array('id'=>\null,'m'=>\null,'s'=>\null);$html='
';} return $html; } }