Phalcon Framework 3.4.1

Error: Call to a member function insertBefore() on null

/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php (110)
#0Cms\Modules\Highnews\Controllers\ArticleController->addMobifosAds(<p><img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 1" src="http://img.2tin.net/uploads/images/2018/10/06/68b178a548ed8330314f3a6acd2f7457_856a52e5bfdc40bb85151140b91ba9f8/68b178a548ed8330314f3a6acd2f7457.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 1" width="1200" height="800" class=" img-responsive"><em><strong>Aquaman</strong></em><strong> (2018) - Black Manta ph&#7843;n b&#7897;i Orm?</strong> G&#7847;n &#273;&acirc;y, nhi&#7873;u l&#7901;i &#273;&#7891;n &#273;o&aacute;n cho r&#7857;ng Black Manta (Yahya Abdul-Mateen II) s&#7869; xu&#7845;t hi&#7879;n &#7903; &#273;o&#7841;n after-credits c&#7911;a <em>Aquaman</em> &#273;&#7875; gia nh&#7853;p nh&oacute;m &aacute;c nh&acirc;n do Lex Luthor (Jesse Eisenberg) &#273;ang r&#7909;c r&#7883;ch th&agrave;nh l&#7853;p. X&eacute;t v&#7873; l&#7883;ch s&#7917; c&#7911;a nguy&ecirc;n t&aacute;c truy&#7879;n tranh, nh&acirc;n v&#7853;t &#273;&oacute;ng vai tr&ograve; quan tr&#7885;ng v&agrave; &#273;&#432;&#7907;c y&ecirc;u th&iacute;ch h&#417;n h&#7859;n Orm (Patrick Wilson). Trong <em>Aquaman</em> s&#7855;p t&#7899;i, Black Manta l&agrave; m&#7897;t t&ecirc;n l&iacute;nh &#273;&aacute;nh thu&ecirc; &#273;&#432;&#7907;c vua Atlantis thu&ecirc; &#273;&#7875; ti&ecirc;u di&#7879;t g&atilde; anh trai c&ugrave;ng m&#7865; kh&aacute;c cha. Nhi&#7873;u kh&#7843; n&#259;ng g&atilde; s&#7869; ph&#7843;n ch&#7911; v&#7899;i m&#7909;c &#273;&iacute;ch t&#432; l&#7907;i. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 2" src="http://img.2tin.net/uploads/images/2018/10/06/2cedef13a7f90fc3e2eb5d32d3509b3a_20a13f079643a2b7d7856fd39ccd46ce/2cedef13a7f90fc3e2eb5d32d3509b3a.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 2" width="1400" height="933" class=" img-responsive"><em><strong>Glass</strong></em><strong> (2019) - Ti&#7871;n s&#297; Ellie Staple l&agrave; k&#7867; ph&#7843;n di&#7879;n?</strong> Trailer &#273;&#7847;u ti&ecirc;n c&#7911;a <em>Glass</em> t&#7853;p trung v&agrave;o cu&#7897;c chi&#7871;n gi&#7919;a David Dunn (Bruce Willis) v&#7899;i The Horde (James McAvoy) v&agrave; Elijah Price (Samuel L. Jackson), nh&#432;ng &#273;&#7841;o di&#7877;n M. Night Shyamalan c&ograve;n &#273;&#7875; l&#7897; m&#7897;t chi ti&#7871;t kh&aacute;c. Ti&#7871;n s&#297; Ellie Staple (Sarah Paulson) l&agrave; chuy&ecirc;n gia t&acirc;m th&#7847;n v&#7873; nh&#7919;ng b&#7879;nh nh&acirc;n &#7843;o t&#432;&#7903;ng r&#7857;ng b&#7843;n th&acirc;n l&agrave; si&ecirc;u anh h&ugrave;ng. &#272;&#7897;i ng&#361; s&#7843;n xu&#7845;t nh&#7845;n m&#7841;nh &#273;&acirc;y l&agrave; m&#7897;t vai ph&#7909; quan tr&#7885;ng. Song, s&#7889; &#273;&ocirc;ng c&ocirc;ng ch&uacute;ng cho r&#7857;ng &#273;&acirc;y m&#7899;i ch&iacute;nh l&agrave; k&#7867; ph&#7843;n di&#7879;n &#273;&iacute;ch th&#7921;c trong <em>Glass</em>, bu&#7897;c ba nh&acirc;n v&#7853;t nam ph&#7843;i h&#7907;p t&aacute;c v&#7899;i nhau. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 3" src="http://img.2tin.net/uploads/images/2018/10/06/94436f1f66c5eae967d468caab01e3fd_4b8c067885aee9736f091958c1923fab/94436f1f66c5eae967d468caab01e3fd.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 3" width="1400" height="934" class=" img-responsive"><em><strong>X-Men: Dark Phoenix</strong></em><strong> (2019) - C&aacute;i ch&#7871;t c&#7911;a Mystique?</strong> B&#7845;y l&acirc;u nay, <em>X-Men: Dark Phoenix</em> b&#7883; &#273;&#7891;n l&agrave; t&#7853;p phim d&#7883; nh&acirc;n cu&#7889;i c&ugrave;ng c&#7911;a b&#7897; t&#7913; James McAvoy, Michael Fassbender, Nicholas Hoult v&agrave; Jennifer Lawrence. Trong &#273;&oacute;, JLaw t&#7915;ng c&oacute; l&#7847;n chia s&#7867; r&#7857;ng c&ocirc; kh&ocirc;ng c&ograve;n m&#7845;y m&#7863;n m&agrave; v&#7899;i d&ograve;ng phim si&ecirc;u anh h&ugrave;ng, v&agrave; khi&#7871;n kh&aacute;n gi&#7843; lo l&#7855;ng v&#7873; t&#432;&#417;ng lai c&#7911;a nh&acirc;n v&#7853;t Mystique. G&#7847;n &#273;&acirc;y, trailer &#273;&#7847;u ti&ecirc;n c&#7911;a <em>Dark Phoenix </em>cho th&#7845;y h&igrave;nh &#7843;nh c&#7911;a m&#7897;t &#273;&aacute;m tang m&agrave; n&#7919; d&#7883; nh&acirc;n ho&agrave;n to&agrave;n v&#7855;ng m&#7863;t. &#272;i&#7873;u &#273;&oacute; c&agrave;ng khi&#7871;n fan c&#7911;a Mystique th&ecirc;m lo &acirc;u. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 4" src="http://img.2tin.net/uploads/images/2018/10/06/a9f146119bdd5ccce77f43804bba2820_a242bf24a67d156046a385ae72e9fe2f/a9f146119bdd5ccce77f43804bba2820.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 4" width="1200" height="800" class=" img-responsive"><em><strong>Captain Marvel</strong></em><strong> (2019) - T&#7897;c Skrulls khi&#7871;n Nick Fury ch&#7897;t m&#7855;t?</strong> Trailer &#273;&#7847;u ti&ecirc;n c&#7911;a <em>Captain Marvel</em> cho th&#7845;y b&#7889;i c&#7843;nh th&#7853;p ni&ecirc;n 1990 v&agrave; Nick Fury (Samuel L. Jackson) c&ograve;n r&#7845;t tr&#7867; trung (nh&#7901; c&ocirc;ng ngh&#7879; k&#7929; x&#7843;o), ch&#432;a b&#7883; m&ugrave; m&#7897;t b&ecirc;n m&#7855;t. Nhi&#7873;u fan c&#7911;a MCU l&#7853;p t&#7913;c d&#7921; &#273;o&aacute;n k&#7867; g&acirc;y ra s&#7921; vi&#7879;c ch&iacute;nh l&agrave; nh&oacute;m ng&#432;&#7901;i Skrull - to&aacute;n ph&#7843;n di&#7879;n trong phim. Skrull c&oacute; kh&#7843; n&#259;ng thay &#273;&#7893;i h&igrave;nh d&#7841;ng, v&agrave; c&oacute; th&#7875; &#273;&atilde; gi&#7843; d&#7841;ng th&agrave;nh Nick Fury, khi&#7871;n nh&acirc;n v&#7853;t th&#7921;c s&#7921; ph&#7843;i t&#7921; l&agrave;m h&#7887;ng m&#7897;t b&ecirc;n m&#7863;t &#273;&#7875; ph&acirc;n bi&#7879;t. Ho&#7863;c c&#361;ng c&oacute; th&#7875; &ocirc;ng b&#7883; th&#432;&#417;ng v&igrave; c&#7913;u Captain Marvel (Brie Larson) trong m&#7897;t t&igrave;nh hu&#7889;ng th&#7853;p t&#7917; nh&#7845;t sinh. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 5" src="http://img.2tin.net/uploads/images/2018/10/06/83c5af4ada3d1b95ebac9c42e5c33ce4_5fe34fc6f65d0bd015695efb112f2794/83c5af4ada3d1b95ebac9c42e5c33ce4.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 5" width="1200" height="800" class=" img-responsive"><em><strong>Once Upon a Time in Hollywood</strong></em><strong> (2019) - Sharon Tate s&#7889;ng s&oacute;t?</strong> M&#7897;t c&acirc;u h&#7887;i m&agrave; nhi&#7873;u kh&aacute;n gi&#7843; &#273;&#7863;t ra cho b&#7897; phim m&#7899;i nh&#7845;t c&#7911;a &#273;&#7841;o di&#7877;n Quentin Tarantino l&agrave; t&aacute;c ph&#7849;m c&oacute; t&aacute;i hi&#7879;n ch&acirc;n th&#7921;c, t&agrave;n b&#7841;o v&#7909; th&#7843;m s&aacute;t &#273;au l&ograve;ng c&#7911;a b&#259;ng &#273;&#7843;ng Mason hay kh&ocirc;ng. Nh&agrave; l&agrave;m phim hi&#7871;m khi tr&aacute;nh n&eacute; y&#7871;u t&#7889; b&#7841;o l&#7921;c, nh&#432;ng &ocirc;ng c&ograve;n n&#7893;i ti&#7871;ng c&oacute; &ldquo;s&#7903; th&iacute;ch&rdquo; thay &#273;&#7893;i l&#7883;ch s&#7917;. B&#7857;ng ch&#7913;ng r&otilde; nh&#7845;t ch&iacute;nh l&agrave; c&aacute;i ch&#7871;t c&#7911;a Adolf Hitler (Martin Wuttke) &#7903; cu&#7889;i phim <em>Inglourious Basterds</em> (2009). Do &#273;&oacute;, ng&#432;&#7901;i h&acirc;m m&#7897; s&#7869; ch&#7859;ng ng&#7841;c nhi&ecirc;n n&#7871;u Sharon Tate (Margot Robbie) s&#7889;ng s&oacute;t r&#7891;i &#273;i tr&#7843; th&ugrave; nh&#7919;ng k&#7867; &#273;&atilde; h&atilde;m h&#7841;i c&ocirc;. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 6" src="http://img.2tin.net/uploads/images/2018/10/06/6f71ab2e6e8bea4e20660dce2142f02a_5d193da02c59baf37d51aeeb8c0a66d0/6f71ab2e6e8bea4e20660dce2142f02a.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 6" width="1400" height="933" class=" img-responsive"><em><strong>Wonder Woman 1984</strong></em><strong> (2019) - Steve Trevor ch&#7855;c ch&#7855;n &#273;&atilde; ch&#7871;t?</strong> Qu&aacute; tr&igrave;nh qu&#7843;ng b&aacute; c&#7911;a <em>Wonder Woman 1984</em> &#273;ang c&#7889; &ldquo;d&#7909; d&#7895;&rdquo; ng&#432;&#7901;i h&acirc;m m&#7897; r&#7857;ng Steve Trevor (Chris Pine) b&#7857;ng c&aacute;ch n&agrave;o &#273;&oacute; &#273;&atilde; tho&aacute;t ch&#7871;t trong v&#7909; n&#7893; m&aacute;y bay, v&agrave; s&#7889;ng s&oacute;t su&#7889;t 65 n&#259;m sau &#273;&oacute; m&agrave; kh&ocirc;ng gi&agrave; &#273;i. Song, chuy&#7879;n n&agrave;y r&#7845;t kh&oacute; x&#7843;y ra. S&#7921; xu&#7845;t hi&#7879;n c&#7911;a Trevor Pine c&oacute; th&#7875; l&agrave; &#7843;o gi&aacute;c do Cheetah (Kristen Wigg) t&#7841;o ra &#273;&#7875; Wonder Woman (Gal Gadot) b&#7883; m&#7845;t t&#7853;p trung. Ho&#7863;c ch&agrave;ng phi c&ocirc;ng &#273;&atilde; c&oacute; con t&#7915; tr&#432;&#7899;c khi g&#7863;p ng&#432;&#7901;i &#273;&#7865;p, v&agrave; vai di&#7877;n c&#7911;a Chris Pine th&#7921;c ch&#7845;t l&agrave; ch&aacute;u n&#7897;i c&#7911;a Steve Trevor. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 7" src="http://img.2tin.net/uploads/images/2018/10/06/f33bc49d77bde6fb581ec04f3566ba8a_f0c012ed32ab396f8ff1d981d7709049/f33bc49d77bde6fb581ec04f3566ba8a.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 7" width="1200" height="800" class=" img-responsive"><em><strong>Star Wars: Episode IX</strong></em><strong> (2019) - Kylo Ren n&oacute;i d&#7889;i v&#7873; th&acirc;n ph&#7853;n c&#7911;a Rey?</strong> Nhi&#7873;u fan ru&#7897;t c&#7911;a <em>Star Wars</em> v&#7851;n ch&#432;a h&#7871;t b&#7921;c b&#7897;i khi Kylo Ren (Adam Driver) h&eacute; l&#7897; r&#7857;ng cha m&#7865; c&#7911;a Rey (Daisy Ridley) ch&#7881; l&agrave; ng&#432;&#7901;i b&igrave;nh th&#432;&#7901;ng. Xuy&ecirc;n su&#7889;t ph&#7847;n <em>The Force Awakens </em>(2015), Disney &#273;&atilde; x&acirc;y d&#7921;ng m&#7889;i li&ecirc;n k&#7871;t &#273;&#7863;c bi&#7879;t gi&#7919;a nh&acirc;n v&#7853;t v&agrave; gia &#273;&igrave;nh Skywalker, khi&#7871;n nhi&#7873;u ng&#432;&#7901;i t&#432;&#7903;ng r&#7857;ng cha c&ocirc; ch&iacute;nh l&agrave; Luke (Mark Hamill). Vi&#7879;c &#273;&#7841;o di&#7877;n J.J. Abrams quay l&#7841;i v&#7883; tr&iacute; &#273;&#7841;o di&#7877;n cho <em>Star Wars: Episode IX</em> c&oacute; th&#7875; khi&#7871;n chi ti&#7871;t v&#7873; th&acirc;n th&#7871; c&#7911;a Rey &#273;&#432;&#7907;c l&#7853;t l&#7841;i. <img title="D&#7921; &#273;o&aacute;n d&#7877; th&#7845;y v&#7873; 'Captain Marvel' v&agrave; c&aacute;c bom t&#7845;n s&#7855;p ra m&#7855;t h&igrave;nh &#7843;nh 8" src="http://img.2tin.net/uploads/images/2018/10/06/4c5ffc052bb53f7dc0af4f96e8adf32e_280f9b7644b466191ff17d50593c9b5e/4c5ffc052bb53f7dc0af4f96e8adf32e.jpg" alt="Du doan de thay ve 'Captain Marvel' va cac bom tan sap ra mat hinh anh 8" width="1400" height="933" class=" img-responsive"><em><strong>Bond 25</strong></em><strong> (2020) - C&aacute;i ch&#7871;t c&#7911;a Madeleine Swann?</strong> <em>Spectre</em> (2015) kh&eacute;p l&#7841;i v&#7899;i h&igrave;nh &#7843;nh James Bond (Daniel Craig) l&aacute;i xe trong &aacute;nh chi&#7873;u t&agrave; v&#7899;i Madeleine Swann (L&eacute;a Seydoux) v&agrave; d&#432;&#7901;ng nh&#432; &#273;&atilde; b&#7887; l&#7841;i cu&#7897;c &#273;&#7901;i &#273;i&#7879;p vi&ecirc;n. C&ograve;n c&aacute;ch n&agrave;o kh&aacute;c &#273;&#7875; anh tr&#7903; l&#7841;i h&agrave;nh &#273;&#7897;ng ngo&#7841;i tr&#7915; vi&#7879;c khi&#7871;n c&ocirc; ng&#432;&#7901;i t&igrave;nh xinh &#273;&#7865;p b&#7887; m&#7841;ng? &#272;&acirc;y l&agrave; c&aacute;ch c&aacute;c nh&agrave; l&agrave;m phim t&#7915;ng &aacute;p d&#7909;ng trong nhi&#7873;u t&aacute;c ph&#7849;m kh&aacute;c, nh&#432; <em>The Bourne Supremacy</em> (2004). H&#417;n h&#7871;t, nhi&#7873;u ng&#432;&#7901;i &#273;&#7865;p b&ecirc;n c&#7841;nh 007 th&#432;&#7901;ng nh&#7853;n k&#7871;t c&#7909;c ch&#7859;ng m&#7845;y t&#7889;t &#273;&#7865;p, v&agrave; &ldquo;th&oacute;i quen&rdquo; thay &#273;&#7893;i Bond Girl c&#7911;a anh qua t&#7915;ng t&#7853;p v&#7851;n ch&#432;a thay &#273;&#7893;i.</p>)
/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php (46)
<?php
 
namespace Cms\Modules\Highnews\Controllers;
 
use Cms\Helper;
use Cms\IAHelper;
use Cms\Models\Admins;
use Cms\Models\Articles;
use Cms\Models\ArticlesTags;
use Cms\Models\Categories;
use Cms\Models\Tags;
use Cms\Tag;
use Facebook\InstantArticles\Parser\Parser;
use Phalcon\Mvc\View;
 
class ArticleController extends ControllerBase
{
 
    public function indexAction($article_slug = '', $id = null)
    {
        $page = $this->request->get('page', 'int', 1);
        $per_page = 5;
        $offset = (($page - 1) * $per_page) + 4;
 
        $article = $this->__is_bot() ? Articles::findById($id) : Articles::findByIdCache($id);
        if (empty($article) || ($this->admin === null && $article->status != 1)) {
            $this->dispatcher->forward(['controller' => 'error', 'action' => 'show404']);
            return;
        }
 
        // redirect right url
        $uri = $this->tag->article_url($article);
        if (strpos($this->router->getRewriteUri(), $uri) === false) {
            $this->response->redirect($uri);
            return;
        }
 
        if ($page === 1) {
            // add tạm view counter
            Articles::update_view($article->aid);
        }
 
 
        $article->content = $this->addClassToImg($article->content, 'img-responsive');// add class img-responsive to img tag
        $article->content = $this->transforYoutubeIframe($article->content);
        $article->content = $this->addMobifosAds($article->content); //Add fucking ads
        //$article->content = preg_replace('/(<[^>]+) style=".*?"/i', '$1', $article->content); // remove custom style
        $article->source_link = parse_url($article->source_link);
        $article->source_link = isset($article->source_link['host']) ? sprintf('http://%s/', $article->source_link['host']) : '';
 
 
        $category = Categories::getCategoryByArticleId($article->aid, false);
        $categories = Categories::getCategoryByArticleId($article->aid, true);
        $tags = Tags::findByArticleId($article->aid);
 
        $this->tag->setTitle(html_entity_decode($article->title));
 
        $this->view->setVar('admin', Admins::findByIdCache($article->create_by));
        $this->view->setVar('article', $article);
        $this->view->setVar('related_articles', $this->widget_related_top_news_block($article->aid, $category['cid'], 3, 0));
        $this->view->setVar('related_articles_2', $this->widget_most_related_news_block($article->aid, $category['cid'], 1, 3));
        $this->view->setVar('related_articles_3', $this->widget_related_news_block($article->aid, $category['cid'], $per_page, $offset));
        $this->view->setVar('day_transform', ['Chủ nhật', 'Thứ hai', 'Thứ ba', 'Thứ tư', 'Thứ năm', 'Thứ sáu', 'Thứ bảy']);
        $this->view->setVar('category', $category);
        $this->view->setVar('categories', $categories);
        $this->view->setVar('tags', $tags);
        $this->view->setVar('hot_block_1', $this->widget_hot(15, 'hot_block_1'));
 
        $this->view->setVar('publisher', 'https://www.facebook.com/blog2tin/');
        $this->view->setVar('published_time', $article->publish_time);
        $this->view->setVar('modified_time', $article->modify_time);
        $this->view->setVar('og_type', 'article');
        $this->view->setVar('og_image', $article->thumbnail);
        $this->view->setVar('description', $article->introduce);
        $this->view->setVar('rss', ['title' => $article->title, 'link' => $this->url->get('rss/article/' . $article->aid)]);
    }
 
    private function addClassToImg($content, $new_class = '')
    {
        $dom = new \DOMDocument();
        @$dom->loadHTML(mb_convert_encoding('<?xml encoding="utf-8" ?>' . $content, 'HTML-ENTITIES', 'UTF-8'));
        $dom->preserveWhiteSpace = false;
 
        $images = $dom->getElementsByTagName('img');
 
        foreach ($images as $image) {
 
            // the existing classes already on the images
            $existing_classes = $image->getAttribute('class');
 
            if (strpos($existing_classes, $new_class) === false) {
                $new_class = $existing_classes . ' ' . $new_class;
                $image->setAttribute('class', $new_class);
            }
        }
        $body = $dom->saveHTML();
        preg_match("/<body[^>]*>(.*?)<\/body>/is", $body, $match);
        return !empty($match) ? end($match) : '';
    }
 
    private function addMobifosAds($content)
    {
        $dom = new \DOMDocument();
        @$dom->loadHTML(mb_convert_encoding('<?xml encoding="utf-8" ?>' . $content, 'HTML-ENTITIES', 'UTF-8'));
        $dom->preserveWhiteSpace = false;
        $ptags = $dom->getElementsByTagName('p');
        $stop = (int)round($ptags->length/2);
        $p = $ptags->item($stop);
        $ads = $dom->createElement("div","FUCKINGADS");
        $p->parentNode->insertBefore($ads, $p);
        $html = $dom->saveHTML();
        $content = str_replace("FUCKINGADS",'<script src="https://player.cliphub.io/js/clh.js?v=1.3.0"></script><div id="clh_hot_news"></div><script>CLH.hotNews("clh_hot_news", {  cat : "phim,giai-tri",  mobile: true});</script>',$html);
       // return str_replace("ABC",'<script src="https://player.cliphub.io/js/clh.js?v=1.3.0"></script><div id="clh_hot_news"></div><script>CLH.hotNews("clh_hot_news", {  cat : "phim,giai-tri",  mobile: true});</script>',$html);
        return $content;
    }
 
    private function transforYoutubeIframe($content)
    {
        preg_match_all("/<iframe[^>]*src=\"[^\"]*youtu[.]?be.*<\\/iframe>/mi", $content, $matches);
        if (!empty($matches)) {
            foreach ($matches as $match) {
                if (!empty($match[0])) {
                    $new_iframe = $match[0];
                    $dom = new \DOMDocument();
                    @$dom->loadHTML(mb_convert_encoding($match[0], 'HTML-ENTITIES', 'UTF-8'));
                    $dom->preserveWhiteSpace = false;
                    $iframes = $dom->getElementsByTagName('iframe');
                    foreach ($iframes as $iframe) {
                        $existing_classes = $iframe->getAttribute('class');
                        if (!empty($existing_classes)) {
                            $new_class = $existing_classes . ' embed-responsive-item';
                            $iframe->setAttribute('class', $new_class);
                        } else {
                            $iframe->setAttribute('class', 'embed-responsive-item');
                        }
 
                        $body = $dom->saveHTML();
                        $new_iframe = $body;
                    }
                    $content = str_replace($match[0], '<div class="embed-responsive-16by9">' . $new_iframe . '</div>', $content);
                }
            }
        }
        return $content;
    }
 
}
#1Cms\Modules\Highnews\Controllers\ArticleController->indexAction(du-doan-de-thay-ve-captain-marvel-va-cac-bom-tan-sap-ra-mat, 13196)
#2Phalcon\Dispatcher->callActionMethod(Object(Cms\Modules\Highnews\Controllers\ArticleController), indexAction, Array([article_slug] => du-doan-de-thay-ve-captain-marvel-va-cac-bom-tan-sap-ra-mat, [id] => 13196))
#3Phalcon\Dispatcher->dispatch()
#4Phalcon\Mvc\Application->handle()
/srv/www/2tin.net/app/bootstrap_highnews.php (63)
<?php
 
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Application;
 
error_reporting(E_ALL);
 
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');
define('APP_MODULE', 'highnews');
 
/**
 * friendly error
 */
$debug = new \Phalcon\Debug();
$debug->listen();
 
/**
 * The FactoryDefault Dependency Injector automatically registers the services that
 * provide a full stack framework. These default services can be overidden with custom ones.
 */
$di = new FactoryDefault();
 
/**
 * Include general services
 */
require APP_PATH . '/config/services.php';
 
/**
 * Include web environment specific services
 */
require APP_PATH . '/config/services_highnews.php';
 
/**
 * Add debug
 */
if ($di->has('profiler')) {
    $di->getShared('profiler')->addAggregator(new \Fabfuel\Prophiler\Aggregator\Database\QueryAggregator());
    $di->getShared('profiler')->addAggregator(new \Fabfuel\Prophiler\Aggregator\Cache\CacheAggregator());
    $pluginManager = new \Fabfuel\Prophiler\Plugin\Manager\Phalcon($di->getShared('profiler'));
    $pluginManager->register();
}
 
/**
 * Include Autoloader
 */
include APP_PATH . '/config/loader.php';
/**
 * Handle the request
 */
$application = new Application($di);
 
/**
 * Register application modules
 */
$application->registerModules(['highnews' => ['className' => 'Cms\Modules\Highnews\Module']]);
 
/**
 * Include routes
 */
require APP_PATH . '/config/routes.php';
 
$html = $application->handle()->getContent();
 
/**
 * render debug html
 */
if ($di->has('profiler')) {
    $toolbar = new \Fabfuel\Prophiler\Toolbar($di->getShared('profiler'));
    $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
    $html = str_replace('</head>', $toolbar->render() . '</head>', $html);
}
 
/**
 * compress html
 */
if (isset($config->compress) && $config->compress) {
    $html = str_replace(["\n", "\r", "\t"], null, $html);
}
 
echo $html;
#5require(/srv/www/2tin.net/app/bootstrap_highnews.php)
/srv/www/2tin.net/public/highnews/index.php (2)
<?php
require '../../app/bootstrap_highnews.php';
KeyValue
_url/du-doan-de-thay-ve-captain-marvel-va-cac-bom-tan-sap-ra-mat-13196.html
KeyValue
USERnginx
HOME/var/lib/nginx
HTTP_CONNECTIONclose
HTTP_CF_CONNECTING_IP54.92.163.105
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_RAY46bc6302f0265687-IAD
HTTP_X_FORWARDED_FOR162.158.78.152
HTTP_CF_IPCOUNTRYUS
HTTP_ACCEPT_ENCODINGgzip
HTTP_HOST2tin.net
REDIRECT_STATUS200
SERVER_NAME2tin.net
SERVER_PORT80
SERVER_ADDR172.31.16.150
REMOTE_PORT44600
REMOTE_ADDR172.31.16.103
SERVER_SOFTWAREnginx/1.10.2
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.1
DOCUMENT_ROOT/srv/www/2tin.net/public/highnews
DOCUMENT_URI/index.php
REQUEST_URI/du-doan-de-thay-ve-captain-marvel-va-cac-bom-tan-sap-ra-mat-13196.html
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/du-doan-de-thay-ve-captain-marvel-va-cac-bom-tan-sap-ra-mat-13196.html&
SCRIPT_FILENAME/srv/www/2tin.net/public/highnews/index.php
APP_ENVproduction
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1539880197.9647
REQUEST_TIME1539880197
#Path
0/srv/www/2tin.net/public/highnews/index.php
1/srv/www/2tin.net/app/bootstrap_highnews.php
2/srv/www/2tin.net/app/config/services.php
3/srv/www/2tin.net/vendor/autoload.php
4/srv/www/2tin.net/vendor/composer/autoload_real.php
5/srv/www/2tin.net/vendor/composer/ClassLoader.php
6/srv/www/2tin.net/vendor/composer/autoload_static.php
7/srv/www/2tin.net/vendor/guzzlehttp/psr7/src/functions_include.php
8/srv/www/2tin.net/vendor/guzzlehttp/psr7/src/functions.php
9/srv/www/2tin.net/vendor/guzzlehttp/promises/src/functions_include.php
10/srv/www/2tin.net/vendor/guzzlehttp/promises/src/functions.php
11/srv/www/2tin.net/vendor/guzzlehttp/guzzle/src/functions_include.php
12/srv/www/2tin.net/vendor/guzzlehttp/guzzle/src/functions.php
13/srv/www/2tin.net/vendor/react/promise/src/functions_include.php
14/srv/www/2tin.net/vendor/react/promise/src/functions.php
15/srv/www/2tin.net/vendor/swiftmailer/swiftmailer/lib/swift_required.php
16/srv/www/2tin.net/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
17/srv/www/2tin.net/vendor/facebook/graph-sdk/src/Facebook/polyfills.php
18/srv/www/2tin.net/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
19/srv/www/2tin.net/app/config/config.php
20/srv/www/2tin.net/app/config/production/config.php
21/srv/www/2tin.net/app/config/production/config-highnews.php
22/srv/www/2tin.net/app/config/services_highnews.php
23/srv/www/2tin.net/app/config/services_web.php
24/srv/www/2tin.net/app/config/loader.php
25/srv/www/2tin.net/app/config/routes.php
26/srv/www/2tin.net/app/config/routes/highnews.php
27/srv/www/2tin.net/app/modules/highnews/Module.php
28/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php
29/srv/www/2tin.net/app/modules/highnews/controllers/ControllerBase.php
30/srv/www/2tin.net/app/common/library/Browser.php
31/srv/www/2tin.net/app/common/library/Tag.php
32/srv/www/2tin.net/app/common/models/Articles.php
33/srv/www/2tin.net/app/common/models/base/Articles.php
34/srv/www/2tin.net/app/common/models/base/Model.php
35/srv/www/2tin.net/app/common/library/Blameable.php
36/srv/www/2tin.net/app/common/library/RedisDB.php
37/srv/www/2tin.net/app/common/library/ProfilerHelper.php
38/srv/www/2tin.net/vendor/predis/predis/src/Client.php
39/srv/www/2tin.net/vendor/predis/predis/src/ClientInterface.php
40/srv/www/2tin.net/vendor/predis/predis/src/Configuration/Options.php
41/srv/www/2tin.net/vendor/predis/predis/src/Configuration/OptionsInterface.php
42/srv/www/2tin.net/vendor/predis/predis/src/Configuration/ConnectionFactoryOption.php
43/srv/www/2tin.net/vendor/predis/predis/src/Configuration/OptionInterface.php
44/srv/www/2tin.net/vendor/predis/predis/src/Connection/Factory.php
45/srv/www/2tin.net/vendor/predis/predis/src/Connection/FactoryInterface.php
46/srv/www/2tin.net/vendor/predis/predis/src/Connection/Parameters.php
47/srv/www/2tin.net/vendor/predis/predis/src/Connection/ParametersInterface.php
48/srv/www/2tin.net/vendor/predis/predis/src/Connection/StreamConnection.php
49/srv/www/2tin.net/vendor/predis/predis/src/Connection/AbstractConnection.php
50/srv/www/2tin.net/vendor/predis/predis/src/Connection/NodeConnectionInterface.php
51/srv/www/2tin.net/vendor/predis/predis/src/Connection/ConnectionInterface.php
52/srv/www/2tin.net/vendor/predis/predis/src/Command/RawCommand.php
53/srv/www/2tin.net/vendor/predis/predis/src/Command/CommandInterface.php
54/srv/www/2tin.net/vendor/predis/predis/src/Configuration/ProfileOption.php
55/srv/www/2tin.net/vendor/predis/predis/src/Profile/Factory.php
56/srv/www/2tin.net/vendor/predis/predis/src/Profile/RedisVersion320.php
57/srv/www/2tin.net/vendor/predis/predis/src/Profile/RedisProfile.php
58/srv/www/2tin.net/vendor/predis/predis/src/Profile/ProfileInterface.php
59/srv/www/2tin.net/vendor/predis/predis/src/Command/StringGet.php
60/srv/www/2tin.net/vendor/predis/predis/src/Command/Command.php
61/srv/www/2tin.net/vendor/predis/predis/src/Response/Status.php
62/srv/www/2tin.net/vendor/predis/predis/src/Response/ResponseInterface.php
63/srv/www/2tin.net/cache/metadata/meta-cms_models_articles-articles.php
64/srv/www/2tin.net/cache/metadata/map-cms_models_articles.php
65/srv/www/2tin.net/vendor/predis/predis/src/Command/StringSet.php
66/srv/www/2tin.net/vendor/predis/predis/src/Command/KeyExpire.php
Memory
Usage2097152