Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Piwik\Tests\Integration; use Exception; use Matomo\Ini\IniReader; use PHP..

Decoded Output download

<?php
 namespace Piwik\Tests\Integration; use Exception; use Matomo\Ini\IniReader; use PHPUnit\Framework\TestCase; use Piwik\AssetManager\UIAssetFetcher; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Filesystem; use Piwik\Plugin\Manager; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tracker; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase { private $globalConfig; const MINIMUM_PHP_VERSION = "7.2.5"; public function setUp() : void { $iniReader = new IniReader(); $this->globalConfig = $iniReader->readFile(PIWIK_PATH_TEST_TO_ROOT . "/config/global.ini.php"); parent::setUp(); } public function test_TestCaseHasSetGroupsMethod() { $this->assertTrue(method_exists(TestCase::class, "setGroups")); } public function test_minimumPHPVersion_isEnforced() { global $piwik_minimumPHPVersion; $this->assertEquals(self::MINIMUM_PHP_VERSION, $piwik_minimumPHPVersion, "minimum PHP version global variable correctly defined"); } public function test_minimumPhpVersion_isDefinedInComposerJson() { $composerJson = $this->getComposerJsonAsArray(); $this->assertEquals("7.2.9", $composerJson["config"]["platform"]["php"]); $expectedRequirePhp = ">=" . self::MINIMUM_PHP_VERSION; $this->assertEquals($expectedRequirePhp, $composerJson["require"]["php"]); } public function test_icoFilesIconsShouldBeInPngFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.ico"); $files = array_filter($files, function ($value) { return !preg_match("/favicon.ico/", $value); }); $files = array_filter($files, function ($value) { return !preg_match("~icons/src~", $value); }); $this->checkFilesAreInPngFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/core", "*.ico"); $this->checkFilesAreInPngFormat($files); } public function test_pngFilesIconsShouldBeInPngFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.png"); $files = array_filter($files, function ($value) { return !preg_match("/expected-screenshots/", $value) && !preg_match("~icons/src~", $value); }); $this->checkFilesAreInPngFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/core", "*.png"); $this->checkFilesAreInPngFormat($files); } public function test_gifFilesIconsShouldBeInGifFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.gif"); $this->checkFilesAreInGifFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/core", "*.gif"); $this->checkFilesAreInGifFormat($files); } public function test_jpgImagesShouldBeInJpgFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.jpg"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/core", "*.jpg"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.jpeg"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/core", "*.jpeg"); $this->checkFilesAreInJpgFormat($files); } public function test_screenshotsStoredInLfs() { $screenshots = Filesystem::globr(PIWIK_INCLUDE_PATH . "/tests/UI/expected-screenshots", "*.png"); $screenshotsPlugins = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins/*/tests/UI/expected-screenshots", "*.png"); $screenshots = array_merge($screenshots, $screenshotsPlugins); $cleanPath = function ($value) { return str_replace(PIWIK_INCLUDE_PATH . "/", '', $value); }; $screenshots = array_map($cleanPath, $screenshots); $lfsFiles = `git lfs ls-files`; if (empty($lfsFiles)) { $lfsFiles = `git lfs ls-files --exclude=`; } $submodules = `git submodule | awk '{ print \$2 }'`; $submodules = explode("\xa", $submodules); $storedLfsFiles = explode("\xa", $lfsFiles); $cleanRevision = function ($value) { $parts = explode(" ", $value); return array_pop($parts); }; $storedLfsFiles = array_map($cleanRevision, $storedLfsFiles); foreach ($submodules as $submodule) { $submodule = trim(trim($submodule), "./"); $pluginLfsFiles = shell_exec("cd " . PIWIK_DOCUMENT_ROOT . "/" . $submodule . " && git lfs ls-files"); if (!empty($pluginLfsFiles)) { $pluginLfsFiles = explode("\xa", $pluginLfsFiles); $pluginLfsFiles = array_map($cleanRevision, $pluginLfsFiles); $pluginLfsFiles = array_map(function ($val) use($submodule) { return $submodule . "/" . $val; }, $pluginLfsFiles); $storedLfsFiles = array_merge($storedLfsFiles, $pluginLfsFiles); } } $diff = array_diff($screenshots, $storedLfsFiles); $this->assertEmpty($diff, "Some Screenshots are not stored in LFS: " . implode("\xa", $diff)); } public function testCheckThatConfigurationValuesAreProductionValues() { $this->_checkEqual(array("Debug" => "always_archive_data_day"), "0"); $this->_checkEqual(array("Debug" => "always_archive_data_period"), "0"); $this->_checkEqual(array("Debug" => "enable_sql_profiler"), "0"); $this->_checkEqual(array("General" => "time_before_today_archive_considered_outdated"), "900"); $this->_checkEqual(array("General" => "enable_browser_archiving_triggering"), "1"); $this->_checkEqual(array("General" => "default_language"), "en"); $this->_checkEqual(array("Tracker" => "record_statistics"), "1"); $this->_checkEqual(array("Tracker" => "visit_standard_length"), "1800"); $this->_checkEqual(array("Tracker" => "trust_visitors_cookies"), "0"); $this->_checkEqual(array("log" => "log_level"), "WARN"); $this->_checkEqual(array("log" => "log_writers"), array("screen")); $this->_checkEqual(array("log" => "logger_api_call"), null); $this->assertFalse(defined("DEBUG_FORCE_SCHEDULED_TASKS")); $content = file_get_contents(PIWIK_INCLUDE_PATH . "/index.php"); $expected = "define('PIWIK_PRINT_ERROR_BACKTRACE', false);"; $this->assertTrue(false !== strpos($content, $expected), "index.php should contain: " . $expected); } private function _checkEqual($key, $valueExpected) { $section = key($key); $optionName = current($key); $value = null; if (isset($this->globalConfig[$section][$optionName])) { $value = $this->globalConfig[$section][$optionName]; } $this->assertEquals($valueExpected, $value, "{$section} -> {$optionName} was '" . var_export($value, true) . "', expected '" . var_export($valueExpected, true) . "'"); } public function testTemplatesDontContainDebug() { $patternFailIfFound = "dump("; $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "/plugins", "*.twig"); foreach ($files as $file) { if ($file == PIWIK_INCLUDE_PATH . "/plugins/TestRunner/templates/matomo-tests.yml.twig") { continue; } $content = file_get_contents($file); $this->assertFalse(strpos($content, $patternFailIfFound), "found in " . $file); } } public function getTemplateFileExtensions() { $extensions = array(array("htm"), array("html"), array("twig"), array("tpl")); return $extensions; } public function testTemplatesDontContainJquery($extension) { $patternFailIfFound = "jquery"; $allowedFiles = array(PIWIK_INCLUDE_PATH . "/plugins/TestRunner/templates/matomo-tests.yml.twig", PIWIK_INCLUDE_PATH . "/plugins/CoreUpdater/templates/layout.twig", PIWIK_INCLUDE_PATH . "/plugins/Installation/templates/layout.twig", PIWIK_INCLUDE_PATH . "/plugins/Login/templates/loginLayout.twig", PIWIK_INCLUDE_PATH . "/plugins/SEO/tests/resources/whois_response.html", PIWIK_INCLUDE_PATH . "/plugins/SEO/tests/resources/whoiscom_response.html", PIWIK_INCLUDE_PATH . "/tests/UI/screenshot-diffs/singlediff.html", PIWIK_INCLUDE_PATH . "/tests/resources/overlay-test-site-real/", PIWIK_INCLUDE_PATH . "/tests/resources/overlay-test-site/", PIWIK_INCLUDE_PATH . "/vendor/lox/xhprof/xhprof_html/docs/", PIWIK_INCLUDE_PATH . "/vendor/phpunit/", PIWIK_INCLUDE_PATH . "/plugins/Morpheus/icons/", PIWIK_INCLUDE_PATH . "/node_modules/"); $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "*." . $extension); $this->assertFilesDoNotContain($files, $patternFailIfFound, $allowedFiles); } private function assertFilesDoNotContain($files, $patternFailIfFound, $allowedFiles) { $foundPatterns = array(); foreach ($files as $file) { if ($this->isFileOrPathAllowed($allowedFiles, $file)) { continue; } $content = file_get_contents($file); $foundPattern = strpos($content, $patternFailIfFound) !== false; if ($foundPattern) { $foundPatterns[] = $file; } } $this->assertEmpty($foundPatterns, sprintf("Forbidden pattern "%s" was found in the following files ---> please manually delete these files from Git. 

	%s", $patternFailIfFound, implode("\xa\x9", $foundPatterns))); } private function isFileOrPathAllowed($allowedFiles, $file) { foreach ($allowedFiles as $allowedFile) { if (strpos($file, $allowedFile) === 0) { return true; } } return false; } public function testCheckThatGivenPluginsAreDisabledByDefault() { $pluginsShouldBeDisabled = array("DBStats"); foreach ($pluginsShouldBeDisabled as $pluginName) { $this->assertNotContains($pluginName, $this->globalConfig["Plugins"]["Plugins"], "Plugin {$pluginName} is enabled by default but shouldn't."); } } public function testProfilingDisabledInProduction() { require_once "Tracker/Db.php"; $this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, "SQL profiler should be disabled in production! See Db::$profiling"); } public function testPiwikTrackerDebugIsOff() { $this->assertTrue(!isset($GLOBALS["PIWIK_TRACKER_DEBUG"])); $this->assertEquals(0, $this->globalConfig["Tracker"]["debug"]); $tracker = new Tracker(); $this->assertFalse($tracker->isDebugModeEnabled()); } public function test_phpFilesStartWithRightCharacter() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "*.php"); $tested = 0; foreach ($files as $file) { if (strpos($file, "/libs/") !== false) { continue; } $handle = fopen($file, "r"); $expectedStart = "<?php"; $isIniFile = strpos($file, ".ini.php") !== false; if ($isIniFile) { $expectedStart = "; <?php exit;"; } $skipStartFileTest = $this->isSkipPhpFileStartWithPhpBlock($file, $isIniFile); if ($skipStartFileTest) { continue; } $start = fgets($handle, strlen($expectedStart) + 1); $this->assertEquals($start, $expectedStart, "File {$file} does not start with {$expectedStart}"); $tested++; } $this->assertGreaterThan(2000, $tested, "should have tested at least thousand of  php files"); } public function test_jsfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "*.js"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_phpfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "*.php"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_twigfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "*.twig"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_htmlfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "*.html"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_directoriesShouldBeChmod755() { $pluginsPath = realpath(PIWIK_INCLUDE_PATH . "/plugins/"); $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pluginsPath), RecursiveIteratorIterator::SELF_FIRST); $paths = array(); foreach ($objects as $name => $object) { if (is_dir($name) && strpos($name, "/.") === false) { $paths[] = $name; } } $this->assertGreaterThan(50, count($paths), "test at latest 50 directories, got " . count($paths)); foreach ($paths as $pathToTest) { $chmod = substr(decoct(fileperms($pathToTest)), -3); $valid = array("777", "775", "755"); $command = "find {$pluginsPath} -type d -exec chmod 755 {} +"; $this->assertTrue(in_array($chmod, $valid), "Some directories within plugins/ are not chmod 755 \xa
Got: {$chmod} for : {$pathToTest} \xa
" . "Run this command to set all directories to 755: 
{$command}
"); } } public function test_DirectoriesInPluginsFolder_areKnown() { $pluginsBundledWithPiwik = Config::getInstance()->getFromGlobalConfig("Plugins"); $pluginsBundledWithPiwik = $pluginsBundledWithPiwik["Plugins"]; $magicPlugins = 42; $this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins); $plugins = _glob(Manager::getPluginsDirectory() . "*", GLOB_ONLYDIR); $count = 1; foreach ($plugins as $pluginPath) { $pluginName = basename($pluginPath); $addedToGit = $this->isPathAddedToGit($pluginPath); if (!$addedToGit) { continue; } $manager = Manager::getInstance(); $isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName); $pluginList = StaticContainer::get("Piwik\Application\Kernel\PluginList"); $disabled = in_array($pluginName, $pluginList->getCorePluginsDisabledByDefault()) || $isGitSubmodule; $enabled = in_array($pluginName, $pluginsBundledWithPiwik); $this->assertTrue($enabled + $disabled === 1, "Plugin {$pluginName} should be either enabled (in global.ini.php) or disabled (in Piwik\Application\Kernel\PluginList).\xa                It is currently (enabled=" . (int) $enabled . ", disabled=" . (int) $disabled . ")"); $count++; } $this->assertTrue($count > $magicPlugins); } public function testEndOfLines() { foreach (Filesystem::globr(PIWIK_DOCUMENT_ROOT, "*") as $file) { if (strpos($file, "/.git/") !== false || strpos($file, "/documentation/") !== false || strpos($file, "/tests/") !== false || strpos($file, "/lang/") !== false || strpos($file, "yuicompressor") !== false || strpos($file, "/vendor") !== false && strpos($file, "/vendor/piwik") === false || strpos($file, "/tmp/") !== false || strpos($file, "/node_modules/") !== false || strpos($file, "/Morpheus/icons/src/") !== false || strpos($file, "/phantomjs/") !== false) { continue; } if (preg_match("/\.(mmdb|bmp|fdf|gif|deb|deflate|exe|gz|ico|jar|jpg|p12|pdf|png|rar|swf|vsd|z|zip|ttf|so|dat|eps|phar|pyc|gzip|eot|woff|svg|woff2)$/", $file)) { continue; } if (!is_dir($file)) { $contents = file_get_contents($file); if (preg_match("/\.(bat|ps1)$/", $file)) { $contents = str_replace("\xd
", '', $contents); $this->assertTrue(strpos($contents, "
") === false, "Incorrect line endings in " . $file); } else { $hasWindowsEOL = strpos($contents, "\xd
"); $this->assertTrue($hasWindowsEOL === false, "Incorrect line endings \r\n found in " . $file); } } } } public function testPiwikJavaScript() { $pattern = "/\x5b\x5c{2}.*\x5c{2}[\x22\x27]/"; $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . "/js/piwik.js"); $this->assertTrue(preg_match($pattern, $contents) == 0); $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . "/piwik.js"); $this->assertTrue(preg_match($pattern, $contents) == 0); } public function test_piwikJs_minified_isUpToDate() { shell_exec("sed '/<DEBUG>/,/<\/DEBUG>/d' < " . PIWIK_DOCUMENT_ROOT . "/js/piwik.js | sed 's/eval/replacedEvilString/' | java -jar " . PIWIK_DOCUMENT_ROOT . "/tests/resources/yuicompressor/yuicompressor-2.4.8.jar --type js --line-break 1000 | sed 's/replacedEvilString/eval/' | sed 's/^[/][*]/\/*!/' > " . PIWIK_DOCUMENT_ROOT . "/piwik-minified.js"); $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "/piwik-minified.js", PIWIK_DOCUMENT_ROOT . "/piwik.js", "minified /piwik.js is out of date, please re-generate the minified files using instructions in /js/README"); $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "/piwik-minified.js", PIWIK_DOCUMENT_ROOT . "/js/piwik.min.js", "minified /js/piwik.min.js is out of date, please re-generate the minified files using instructions in /js/README"); } public function test_piwikJs_SameAsMatomoJs() { $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "/matomo.js", PIWIK_DOCUMENT_ROOT . "/piwik.js", "/piwik.js does not match /matomo.js, please re-generate the minified files using instructions in /js/README"); } public function testTmpDirectoryContainsGitKeep() { $this->assertFileExists(PIWIK_DOCUMENT_ROOT . "/tmp/.gitkeep"); } private function checkFilesAreInPngFormat($files) { $this->checkFilesAreInFormat($files, "png"); } private function checkFilesAreInJpgFormat($files) { $this->checkFilesAreInFormat($files, "jpeg"); } private function checkFilesAreInGifFormat($files) { $this->checkFilesAreInFormat($files, "gif"); } private function checkFilesAreInFormat($files, $format) { self::expectNotToPerformAssertions(); $errors = array(); foreach ($files as $file) { if (strpos($file, "/libs/") !== false) { continue; } $function = "imagecreatefrom" . $format; if (!function_exists($function)) { throw new \Exception("Unexpected error: {$function} function does not exist!"); } $handle = @$function($file); if (empty($handle)) { $errors[] = $file; } } if (!empty($errors)) { $icons = implode(" ", $errors); $this->fail("{$format} format failed for following icons {$icons} \xa"); } } protected function isSkipPhpFileStartWithPhpBlock($file, $isIniFile) { $isIniFileInTests = strpos($file, "/tests/") !== false; $isTestResultFile = strpos($file, "/System/expected") !== false || strpos($file, "tests/resources/Updater/") !== false || strpos($file, "Twig/Tests/") !== false || strpos($file, "processed/") !== false || strpos($file, "/vendor/") !== false || strpos($file, "tmp/") !== false && strpos($file, "index.php") !== false; $isLib = strpos($file, "lib/xhprof") !== false || strpos($file, "phpunit/phpunit") !== false; return $isIniFile && $isIniFileInTests || $isTestResultFile || $isLib; } protected function isPathAddedToGit($pluginPath) { $gitOutput = shell_exec("git ls-files " . $pluginPath . " --error-unmatch 2>&1"); $addedToGit = strlen($gitOutput) > 0 && strpos($gitOutput, "error: pathspec") === false; return $addedToGit; } public function test_TotalPiwikFilesSize_isWithinReasonnableSize() { if (!SystemTestCase::isCIEnvironment()) { $this->markTestSkipped("Skipped this test on local dev environment."); } $maximumTotalFilesizesExpectedInMb = 62; $minimumTotalFilesizesExpectedInMb = 38; $minimumExpectedFilesCount = 7000; $filesizes = $this->getAllFilesizes(); $sumFilesizes = array_sum($filesizes); $filesOrderedBySize = $filesizes; arsort($filesOrderedBySize); $this->assertLessThan($maximumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, sprintf("Sum of all files should be less than {$maximumTotalFilesizesExpectedInMb} Mb.
                    
Got total file sizes of: %d Mb.\xa                    
Biggest files: %s", $sumFilesizes / 1024 / 1024, var_export(array_slice($filesOrderedBySize, 0, 100, $preserveKeys = true), true))); $this->assertGreaterThan($minimumExpectedFilesCount, count($filesizes), "Expected at least {$minimumExpectedFilesCount} files should be included in Piwik."); $this->assertGreaterThan($minimumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, "expected to have at least {$minimumTotalFilesizesExpectedInMb} Mb of files in Piwik codebase."); } public function test_noUpdatesInCorePlugins() { $manager = Manager::getInstance(); $plugins = $manager->loadAllPluginsAndGetTheirInfo(); $pluginsWithUnexpectedUpdates = array(); $pluginsWithUpdates = array(); $numTestedCorePlugins = 0; $corePluginsThatAreIndependent = array("TagManager", "Provider", "CustomVariables"); foreach ($plugins as $pluginName => $info) { if ($manager->isPluginBundledWithCore($pluginName) && !in_array($pluginName, $corePluginsThatAreIndependent)) { $numTestedCorePlugins++; $pathToUpdates = Manager::getPluginDirectory($pluginName) . "/Updates/*.php"; $files = _glob($pathToUpdates); if (empty($files)) { $files = array(); } foreach ($files as $file) { $fileVersion = basename($file, ".php"); if (version_compare("3.13.0", $fileVersion) != 1) { $pluginsWithUnexpectedUpdates[$pluginName] = $file; } else { $pluginsWithUpdates[] = $pluginName; } } } } $this->assertSame(array(), $pluginsWithUnexpectedUpdates); $this->assertGreaterThan(50, $numTestedCorePlugins); $this->assertSame(array("CustomDimensions", "DevicesDetection", "ExamplePlugin", "Goals", "LanguagesManager"), array_values(array_unique($pluginsWithUpdates))); } public function test_bowerComponentsBc_referencesFilesThatExists() { $filesThatDoNotExist = array(); foreach (UIAssetFetcher::$bowerComponentFileMappings as $oldFile => $newFile) { if ($newFile && !file_exists(PIWIK_DOCUMENT_ROOT . "/" . $newFile)) { $filesThatDoNotExist[] = $newFile; } } $this->assertEmpty($filesThatDoNotExist, "The following asset files in UIAssetFetcher::$bowerComponentFileMappings do not exist: " . implode(", ", $filesThatDoNotExist)); } public function test_noVueHtmlWithoutSanitize() { $command = "grep -r "v-html=" " . PIWIK_INCLUDE_PATH . "/plugins --include=*.vue | grep -v "v-html=['\"]\$sanitize""; $output = shell_exec($command); $errorMessage = ''; if (!empty($output)) { $lines = explode("\xa", $output); $files = array(); foreach ($lines as $line) { if (empty(trim($line))) { continue; } list($file, $match) = explode(":", $line); $files[] = "- " . trim($file); } $errorMessage = "Found uses of v-html without $sanitize:
" . implode("
", $files); } $this->assertEmpty($output, $errorMessage); } private function isFileIncludedInFinalRelease($file) { if (is_dir($file)) { return false; } if ($this->isFileBelongToTests($file)) { return false; } if (strpos($file, PIWIK_INCLUDE_PATH . "/tmp/") !== false) { return false; } if ((strpos($file, "GeoIP") !== false || strpos($file, "DBIP") !== false) && strpos($file, ".mmdb") !== false) { return false; } if ($this->isFileIsAnIconButDoesNotBelongToDistribution($file)) { return false; } if ($this->isPluginSubmoduleAndThereforeNotFoundInFinalRelease($file)) { return false; } if ($this->isFileBelongToComposerDevelopmentPackage($file)) { return false; } if ($this->isFileDeletedFromPackage($file)) { return false; } return true; } private function isPluginSubmoduleAndThereforeNotFoundInFinalRelease($file) { if (strpos($file, PIWIK_INCLUDE_PATH . "/plugins/") === false) { return false; } $pluginName = str_replace(PIWIK_INCLUDE_PATH . "/plugins/", '', $file); $pluginName = substr($pluginName, 0, strpos($pluginName, "/")); $this->assertNotEmpty($pluginName, "Detected an empty plugin name from path: {$file} "); $pluginManager = Manager::getInstance(); $notInPackagedRelease = $pluginManager->isPluginOfficialAndNotBundledWithCore($pluginName); if ($pluginName == "VisitorGenerator") { $this->assertTrue($notInPackagedRelease, "Expected isPluginOfficialAndNotBundledWithCore to return true for VisitorGenerator plugin"); } return $notInPackagedRelease; } private function isFileBelongToComposerDevelopmentPackage($file) { $composerDependencyDevOnly = $this->getComposerRequireDevPackages(); return $this->isFilePathFoundInArray($file, $composerDependencyDevOnly); } private function getComposerRequireDevPackages() { $composerJson = $this->getComposerLockAsArray(); $composerDependencyDevOnly = array_column($composerJson["packages-dev"], "name"); return $composerDependencyDevOnly; } private function isFilePathFoundInArray($file, $filesToMatchAgainst) { foreach ($filesToMatchAgainst as $fileToMatchAgainst) { if (strpos($file, $fileToMatchAgainst) !== false || fnmatch(PIWIK_INCLUDE_PATH . "/" . $fileToMatchAgainst, $file)) { return true; } } return false; } private function isFileDeletedFromPackage($file) { $filesAndFoldersToDeleteFromPackage = array("composer.phar", "vendor/bin/", "vendor/container-interop/container-interop/docs", "vendor/davaxi/sparkline/composer-8.json", "vendor/davaxi/sparkline/docker-compose.yml", "vendor/davaxi/sparkline/Dockerfile", "vendor/geoip2/geoip2/examples/", "vendor/lox/xhprof/bin", "vendor/lox/xhprof/examples", "vendor/lox/xhprof/scripts", "vendor/lox/xhprof/extension", "vendor/lox/xhprof/xhprof_html", "vendor/maxmind-db/reader/ext/", "vendor/maxmind-db/reader/autoload.php", "vendor/maxmind-db/reader/CHANGELOG.md", "vendor/maxmind/web-service-common/dev-bin/", "vendor/maxmind/web-service-common/CHANGELOG.md", "vendor/pear/archive_tar/docs", "vendor/php-di/invoker/doc/", "vendor/php-di/php-di/benchmarks/", "vendor/symfony/console/Symfony/Component/Console/Resources/bin", "vendor/szymach/c-pchart/resources/doc", "vendor/szymach/c-pchart/coverage.sh", "vendor/szymach/c-pchart/codeception.yml", "vendor/tecnickcom/tcpdf/examples", "vendor/tecnickcom/tcpdf/tools", "vendor/tecnickcom/tcpdf/CHANGELOG.TXT", "vendor/twig/twig/test/", "vendor/twig/twig/doc/", "vendor/twig/twig/.php-cs-fixer.dist.php", "config/environment/test.php", "config/environment/ui-test.php", "plugins/*/config/test.php", "plugins/*/config/ui-test.php", "plugins/Morpheus/icons/src*", "plugins/Morpheus/icons/tools*", "plugins/Morpheus/icons/flag-icon-css*", "plugins/Morpheus/icons/submodules*", "plugins/Morpheus/icons/.git*", "plugins/Morpheus/icons/*.py", "plugins/Morpheus/icons/*.sh", "plugins/Morpheus/icons/*.json", "plugins/Morpheus/icons/*.lock", "plugins/Morpheus/icons/*.svg", "plugins/Morpheus/icons/*.txt", "plugins/Morpheus/icons/*.php", "plugins/Morpheus/icons/*.yml", "plugins/Example*", "vendor/tecnickcom/tcpdf/fonts/ae_fonts_2.0", "vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.33", "vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34", "vendor/tecnickcom/tcpdf/fonts/freefont-20100919", "vendor/tecnickcom/tcpdf/fonts/freefont-20120503", "vendor/tecnickcom/tcpdf/fonts/freemon*", "vendor/tecnickcom/tcpdf/fonts/cid*", "vendor/tecnickcom/tcpdf/fonts/courier*", "vendor/tecnickcom/tcpdf/fonts/aefurat*", "vendor/tecnickcom/tcpdf/fonts/dejavusansb*", "vendor/tecnickcom/tcpdf/fonts/dejavusansi*", "vendor/tecnickcom/tcpdf/fonts/dejavusansmono*", "vendor/tecnickcom/tcpdf/fonts/dejavusanscondensed*", "vendor/tecnickcom/tcpdf/fonts/dejavusansextralight*", "vendor/tecnickcom/tcpdf/fonts/dejavuserif*", "vendor/tecnickcom/tcpdf/fonts/freesansi*", "vendor/tecnickcom/tcpdf/fonts/freesansb*", "vendor/tecnickcom/tcpdf/fonts/freeserifb*", "vendor/tecnickcom/tcpdf/fonts/freeserifi*", "vendor/tecnickcom/tcpdf/fonts/pdf*", "vendor/tecnickcom/tcpdf/fonts/times*", "vendor/tecnickcom/tcpdf/fonts/uni2cid*", "vendor/szymach/c-pchart/resources/fonts/advent_light*", "vendor/szymach/c-pchart/resources/fonts/Bedizen*", "vendor/szymach/c-pchart/resources/fonts/calibri*", "vendor/szymach/c-pchart/resources/fonts/Forgotte*", "vendor/szymach/c-pchart/resources/fonts/MankSans*", "vendor/szymach/c-pchart/resources/fonts/pf_arma_five*", "vendor/szymach/c-pchart/resources/fonts/Silkscreen*", "vendor/szymach/c-pchart/resources/fonts/verdana*", "node_modules/chroma-js/Makefile", "node_modules/chroma-js/chroma.js", "node_modules/chroma-js/doc", "node_modules/chroma-js/readme.md", "node_modules/chroma-js/src", "node_modules/chroma-js/test", "node_modules/iframe-resizer/js/iframeResizer.contentWindow.js", "node_modules/iframe-resizer/js/iframeResizer.js", "node_modules/iframe-resizer/src/ie8.polyfils.js", "node_modules/iframe-resizer/src/iframeResizer.contentWindow.js", "node_modules/iframe-resizer/src/iframeResizer.js", "node_modules/iframe-resizer/test-main.js", "node_modules/jquery/dist/jquery.js", "node_modules/jquery/src", "node_modules/jquery/external", "node_modules/jquery-ui-dist/component.json", "node_modules/jquery-ui-dist/external", "node_modules/jquery-ui-dist/images", "node_modules/jquery-ui-dist/index.html", "node_modules/jquery-ui-dist/jquery-ui.css", "node_modules/jquery-ui-dist/jquery-ui.js", "node_modules/jquery-ui-dist/jquery-ui.structure.css", "node_modules/jquery-ui-dist/jquery-ui.theme.css", "node_modules/jquery.dotdotdot/gulpfile.js", "node_modules/jquery.dotdotdot/index.html", "node_modules/jquery.dotdotdot/dotdotdot.jquery.json", "node_modules/jquery.dotdotdot/src", "node_modules/jquery.scrollto/jquery.scrollTo.js", "node_modules/jquery.scrollto/scrollTo.jquery.json", "node_modules/jquery.scrollto/changes.txt", "node_modules/jquery.scrollto/demo", "node_modules/@materializecss/materialize/extras", "node_modules/@materializecss/materialize/js", "node_modules/@materializecss/materialize/sass", "node_modules/@materializecss/materialize/dist/js/materialize.js", "node_modules/@materializecss/materialize/dist/css/materialize.css", "node_modules/mousetrap/mousetrap.js", "node_modules/mousetrap/plugins", "node_modules/mousetrap/mousetrap.sublime-project", "node_modules/ng-dialog/CONTRIBUTING.md", "node_modules/ng-dialog/css", "node_modules/ng-dialog/example", "node_modules/ng-dialog/protractor.conf.js", "node_modules/ng-dialog/server.js", "node_modules/qrcodejs2/index-svg.html", "node_modules/qrcodejs2/index.html", "node_modules/qrcodejs2/index.svg", "node_modules/qrcodejs2/jquery.min.js", "node_modules/qrcodejs2/qrcode.js", "node_modules/sprintf-js/CONTRIBUTORS.MD", "node_modules/sprintf-js/README.md", "node_modules/sprintf-js/src", "node_modules/visibilityjs/ChangeLog.md", "node_modules/visibilityjs/component.json", "node_modules/visibilityjs/index.d.ts", "node_modules/visibilityjs/index.js", "node_modules/visibilityjs/README.md", "node_modules/vue/dist/vue.cjs.js", "node_modules/vue/dist/vue.cjs.prod.js", "node_modules/vue/dist/vue.d.ts", "node_modules/vue/dist/vue.esm-browser.js", "node_modules/vue/dist/vue.esm-browser.prod.js", "node_modules/vue/dist/vue.esm-bundler.js", "node_modules/vue/dist/vue.runtime.esm-browser.js", "node_modules/vue/dist/vue.runtime.esm-browser.prod.js", "node_modules/vue/dist/vue.runtime.esm-bundler.js", "node_modules/vue/dist/vue.runtime.global.js", "node_modules/vue/dist/vue.runtime.global.prod.js", "libs/jqplot/jqplot.core.js", "libs/jqplot/jqplot.lineRenderer.js", "libs/jqplot/jqplot.linearAxisRenderer.js", "libs/jqplot/jqplot.themeEngine.js", "libs/jqplot/plugins/jqplot.barRenderer.js", "libs/jqplot/plugins/jqplot.pieRenderer.js", "config/config.php", "*.gitignore", "*.gitmodules", "*.gitattributes", "*.git-blame-ignore-revs", "*.bowerrc", "*.bower.json", "*bower.json", "*.coveralls.yml", "*.editorconfig", "*.gitkeep", "*.jshintrc", "*.php_cs", "*.php_cs.dist", "*phpunit.xml.dist", "*phpunit.xml", "*.phpcs.xml.dist", "*phpcs.xml", "*Gruntfile.js", "*gruntfile.js", "*.map", "*.travis.yml", "*installed.json", "*package.json", "*package-lock.json", "*yarn.lock", "*.scrutinizer.yml", "*.gitstats.yml", "*composer.json", "*composer.lock", "*.spec.js", "*.phpstorm.meta.php", "*.lfsconfig", "*.travis.sh", "*tsconfig.json", "*tsconfig.spec.json", "*.eslintrc.js", "*.eslintignore", "*.eslintrc", "*.browserslistrc", "*babel.config.js", "*jest.config.js", "*karma.conf.js", "*karma-conf.js", "*vue.config.js", "*.npmignore", "*.ncurc.json", "*.prettierrc", "*.jscsrc", "*phpstan.neon", "*phpstan.neon.dist", "*package.xml", "*.stylelintrc.json"); return $this->isFilePathFoundInArray($file, $filesAndFoldersToDeleteFromPackage); } private function getAllFilesizes() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "*"); $filesizes = array(); foreach ($files as $file) { if (!$this->isFileIncludedInFinalRelease($file)) { continue; } $filesize = filesize($file); if ($filesize === false) { throw new Exception("Error getting filesize for file: {$file}"); } $filesizes[$file] = $filesize; } return $filesizes; } protected function checkFilesDoNotHaveWeirdSpaces($files) { $weirdSpace = "\xc2\xa0"; $this->assertEquals("c2a0", bin2hex($weirdSpace), "Checking that this test file was not tampered with"); $this->assertEquals("20", bin2hex(" "), "Checking that this test file was not tampered with"); $errors = array(); $countFileChecked = 0; foreach ($files as $file) { if ($this->isFileBelongToTests($file) || is_dir($file)) { continue; } if (strpos($file, "vendor/php-di/php-di/website/") !== false || strpos($file, "vendor/phpmailer/phpmailer/language/") !== false || strpos($file, "vendor/wikimedia/less.php/") !== false || strpos($file, "node_modules/") !== false || strpos($file, "vendor/mayflower/mo4-coding-standard/") !== false || strpos($file, "vendor/symfony/polyfill-iconv/") !== false || strpos($file, "vendor/symfony/polyfill-intl-normalizer/") !== false || strpos($file, "plugins/CoreVue/polyfills/dist/MatomoPolyfills.min.js") !== false || strpos($file, "plugins/VisitorGenerator/vendor/fzaninotto/faker/src/Faker/Provider/") !== false || preg_match("%/plugins/[a-zA-Z0-9_]+/vue/dist%", $file)) { continue; } $content = file_get_contents($file); $posWeirdSpace = strpos($content, $weirdSpace); if ($posWeirdSpace !== false) { $around = substr($content, $posWeirdSpace - 20, 40); $around = trim($around); $errors[] = "File {$file} contains an unusual space character, please remove it from here: ...{$around}..."; } $countFileChecked++; } $this->assertGreaterThan(1, $countFileChecked, "expected to test at least one file, but tested only " . $countFileChecked); if (!empty($errors)) { throw new Exception(implode(",
\xa ", $errors)); } } private function isFileBelongToTests($file) { return stripos($file, "/tests/") !== false || stripos($file, "/phantomjs/") !== false; } private function getComposerJsonAsArray() { $composer = file_get_contents(PIWIK_INCLUDE_PATH . "/composer.json"); $composerJson = json_decode($composer, $assoc = true); return $composerJson; } private function getComposerLockAsArray() { $composer = file_get_contents(PIWIK_INCLUDE_PATH . "/composer.lock"); $composerJson = json_decode($composer, $assoc = true); return $composerJson; } private function isFileIsAnIconButDoesNotBelongToDistribution($file) { return preg_match("~Morpheus/icons/(?!dist)~", $file); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Piwik\Tests\Integration; use Exception; use Matomo\Ini\IniReader; use PHPUnit\Framework\TestCase; use Piwik\AssetManager\UIAssetFetcher; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Filesystem; use Piwik\Plugin\Manager; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tracker; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase { private $globalConfig; const MINIMUM_PHP_VERSION = "\x37\56\62\x2e\65"; public function setUp() : void { $iniReader = new IniReader(); $this->globalConfig = $iniReader->readFile(PIWIK_PATH_TEST_TO_ROOT . "\x2f\143\x6f\156\146\151\147\57\147\x6c\x6f\142\x61\x6c\56\x69\x6e\151\x2e\160\x68\160"); parent::setUp(); } public function test_TestCaseHasSetGroupsMethod() { $this->assertTrue(method_exists(TestCase::class, "\x73\145\x74\x47\162\x6f\x75\160\x73")); } public function test_minimumPHPVersion_isEnforced() { global $piwik_minimumPHPVersion; $this->assertEquals(self::MINIMUM_PHP_VERSION, $piwik_minimumPHPVersion, "\x6d\x69\156\x69\x6d\x75\155\40\120\110\120\x20\x76\145\162\x73\151\x6f\156\x20\147\154\x6f\142\x61\154\40\166\x61\162\x69\141\142\154\145\x20\143\x6f\x72\162\x65\x63\x74\x6c\171\x20\x64\x65\146\x69\x6e\x65\144"); } public function test_minimumPhpVersion_isDefinedInComposerJson() { $composerJson = $this->getComposerJsonAsArray(); $this->assertEquals("\x37\x2e\x32\x2e\x39", $composerJson["\x63\157\x6e\x66\151\147"]["\x70\154\x61\x74\146\157\162\x6d"]["\x70\x68\160"]); $expectedRequirePhp = "\x3e\x3d" . self::MINIMUM_PHP_VERSION; $this->assertEquals($expectedRequirePhp, $composerJson["\162\x65\161\165\151\x72\x65"]["\x70\150\160"]); } public function test_icoFilesIconsShouldBeInPngFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\160\x6c\x75\x67\x69\156\163", "\x2a\56\x69\143\x6f"); $files = array_filter($files, function ($value) { return !preg_match("\57\146\x61\166\151\143\157\x6e\56\x69\x63\x6f\57", $value); }); $files = array_filter($files, function ($value) { return !preg_match("\x7e\151\143\x6f\x6e\163\x2f\163\162\143\x7e", $value); }); $this->checkFilesAreInPngFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\x63\157\162\x65", "\x2a\56\151\143\x6f"); $this->checkFilesAreInPngFormat($files); } public function test_pngFilesIconsShouldBeInPngFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\x2f\x70\154\x75\x67\151\156\x73", "\52\x2e\160\x6e\147"); $files = array_filter($files, function ($value) { return !preg_match("\57\145\x78\x70\x65\143\164\145\x64\55\163\143\162\x65\x65\x6e\163\x68\157\x74\163\x2f", $value) && !preg_match("\x7e\151\x63\157\156\163\x2f\x73\162\x63\176", $value); }); $this->checkFilesAreInPngFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\x2f\x63\157\162\145", "\x2a\56\x70\156\x67"); $this->checkFilesAreInPngFormat($files); } public function test_gifFilesIconsShouldBeInGifFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\x70\x6c\x75\147\x69\156\x73", "\x2a\56\x67\x69\x66"); $this->checkFilesAreInGifFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\x2f\143\157\162\x65", "\52\x2e\147\x69\146"); $this->checkFilesAreInGifFormat($files); } public function test_jpgImagesShouldBeInJpgFormat() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\x70\x6c\x75\147\x69\156\x73", "\52\x2e\x6a\x70\147"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\143\x6f\x72\145", "\52\56\x6a\160\x67"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\x2f\160\154\165\x67\x69\x6e\x73", "\52\56\152\x70\145\x67"); $this->checkFilesAreInJpgFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\x63\x6f\x72\x65", "\x2a\56\x6a\160\x65\x67"); $this->checkFilesAreInJpgFormat($files); } public function test_screenshotsStoredInLfs() { $screenshots = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\x74\x65\x73\x74\x73\57\x55\x49\57\x65\x78\x70\x65\x63\x74\x65\144\55\163\x63\162\x65\x65\x6e\x73\150\x6f\164\163", "\x2a\x2e\160\156\147"); $screenshotsPlugins = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\160\154\165\x67\x69\x6e\163\57\x2a\x2f\x74\x65\x73\x74\163\x2f\x55\x49\57\x65\x78\160\x65\143\164\x65\144\x2d\163\x63\162\x65\x65\156\x73\x68\x6f\164\163", "\52\x2e\160\156\x67"); $screenshots = array_merge($screenshots, $screenshotsPlugins); $cleanPath = function ($value) { return str_replace(PIWIK_INCLUDE_PATH . "\57", '', $value); }; $screenshots = array_map($cleanPath, $screenshots); $lfsFiles = `git lfs ls-files`; if (empty($lfsFiles)) { $lfsFiles = `git lfs ls-files --exclude=`; } $submodules = `git submodule | awk '{ print \$2 }'`; $submodules = explode("\xa", $submodules); $storedLfsFiles = explode("\xa", $lfsFiles); $cleanRevision = function ($value) { $parts = explode("\40", $value); return array_pop($parts); }; $storedLfsFiles = array_map($cleanRevision, $storedLfsFiles); foreach ($submodules as $submodule) { $submodule = trim(trim($submodule), "\x2e\x2f"); $pluginLfsFiles = shell_exec("\x63\144\40" . PIWIK_DOCUMENT_ROOT . "\57" . $submodule . "\40\46\x26\x20\x67\151\x74\40\x6c\x66\163\x20\x6c\163\55\x66\x69\x6c\145\163"); if (!empty($pluginLfsFiles)) { $pluginLfsFiles = explode("\xa", $pluginLfsFiles); $pluginLfsFiles = array_map($cleanRevision, $pluginLfsFiles); $pluginLfsFiles = array_map(function ($val) use($submodule) { return $submodule . "\x2f" . $val; }, $pluginLfsFiles); $storedLfsFiles = array_merge($storedLfsFiles, $pluginLfsFiles); } } $diff = array_diff($screenshots, $storedLfsFiles); $this->assertEmpty($diff, "\x53\157\155\x65\x20\x53\x63\x72\x65\145\x6e\163\x68\157\164\x73\x20\x61\x72\x65\x20\x6e\157\164\40\163\164\157\x72\x65\x64\40\151\156\40\x4c\106\x53\72\40" . implode("\xa", $diff)); } public function testCheckThatConfigurationValuesAreProductionValues() { $this->_checkEqual(array("\x44\145\x62\165\x67" => "\141\154\x77\141\x79\x73\137\141\x72\143\x68\x69\166\145\x5f\x64\x61\164\x61\x5f\144\141\171"), "\x30"); $this->_checkEqual(array("\104\x65\x62\165\x67" => "\141\154\x77\141\x79\163\137\x61\162\x63\x68\x69\166\145\x5f\x64\141\164\141\137\160\145\162\x69\x6f\144"), "\60"); $this->_checkEqual(array("\104\x65\x62\165\x67" => "\145\x6e\x61\142\154\145\x5f\163\x71\154\x5f\x70\x72\157\x66\x69\154\x65\x72"), "\60"); $this->_checkEqual(array("\x47\145\156\145\x72\x61\154" => "\x74\151\x6d\145\137\x62\145\146\x6f\x72\145\x5f\x74\157\x64\x61\x79\x5f\x61\162\143\x68\x69\166\x65\x5f\143\157\156\x73\x69\144\145\162\x65\x64\137\x6f\x75\164\x64\x61\x74\x65\144"), "\x39\60\x30"); $this->_checkEqual(array("\x47\x65\156\x65\x72\141\x6c" => "\x65\x6e\141\142\x6c\145\137\x62\162\x6f\167\x73\145\x72\x5f\x61\x72\x63\150\x69\x76\x69\156\x67\x5f\x74\x72\151\x67\x67\145\x72\151\156\147"), "\x31"); $this->_checkEqual(array("\107\x65\156\145\162\141\154" => "\144\145\x66\141\x75\154\x74\x5f\x6c\141\x6e\x67\x75\141\147\145"), "\x65\x6e"); $this->_checkEqual(array("\124\162\x61\x63\153\145\x72" => "\162\145\x63\x6f\x72\x64\x5f\x73\164\x61\x74\151\x73\164\x69\143\163"), "\x31"); $this->_checkEqual(array("\x54\162\141\143\x6b\x65\162" => "\166\151\163\151\x74\137\163\x74\x61\x6e\x64\x61\x72\144\137\154\x65\156\147\164\x68"), "\61\x38\x30\x30"); $this->_checkEqual(array("\124\x72\141\143\153\145\x72" => "\164\162\165\163\x74\137\x76\x69\163\151\164\x6f\x72\163\137\x63\157\157\x6b\151\145\x73"), "\60"); $this->_checkEqual(array("\x6c\157\147" => "\154\157\x67\137\x6c\145\x76\145\x6c"), "\127\101\x52\x4e"); $this->_checkEqual(array("\154\x6f\x67" => "\x6c\157\x67\x5f\167\162\151\x74\145\x72\x73"), array("\163\x63\162\145\x65\x6e")); $this->_checkEqual(array("\154\x6f\x67" => "\x6c\x6f\147\x67\145\x72\x5f\141\x70\151\137\143\x61\154\154"), null); $this->assertFalse(defined("\104\x45\x42\x55\x47\137\106\117\x52\x43\105\x5f\123\x43\x48\x45\x44\x55\x4c\x45\104\137\124\101\123\113\123")); $content = file_get_contents(PIWIK_INCLUDE_PATH . "\57\x69\x6e\x64\145\170\56\160\150\160"); $expected = "\x64\x65\x66\x69\156\x65\50\x27\x50\x49\127\x49\113\x5f\120\122\111\116\124\137\x45\x52\122\117\x52\x5f\x42\x41\103\x4b\124\x52\x41\x43\105\47\54\40\146\141\154\x73\145\x29\73"; $this->assertTrue(false !== strpos($content, $expected), "\151\156\144\x65\170\56\x70\x68\x70\40\x73\x68\157\x75\154\x64\40\x63\x6f\x6e\164\x61\151\156\x3a\40" . $expected); } private function _checkEqual($key, $valueExpected) { $section = key($key); $optionName = current($key); $value = null; if (isset($this->globalConfig[$section][$optionName])) { $value = $this->globalConfig[$section][$optionName]; } $this->assertEquals($valueExpected, $value, "{$section}\x20\55\x3e\x20{$optionName}\40\167\x61\x73\x20\47" . var_export($value, true) . "\x27\x2c\40\145\x78\x70\145\x63\x74\x65\x64\40\x27" . var_export($valueExpected, true) . "\x27"); } public function testTemplatesDontContainDebug() { $patternFailIfFound = "\x64\165\x6d\160\50"; $files = Filesystem::globr(PIWIK_INCLUDE_PATH . "\57\160\154\165\147\x69\156\163", "\52\x2e\164\x77\x69\x67"); foreach ($files as $file) { if ($file == PIWIK_INCLUDE_PATH . "\57\x70\x6c\165\x67\151\156\163\x2f\124\145\163\x74\x52\x75\x6e\156\x65\x72\x2f\x74\x65\155\160\x6c\141\x74\145\163\x2f\155\x61\164\157\155\x6f\55\164\x65\163\x74\x73\x2e\x79\x6d\154\x2e\164\x77\x69\x67") { continue; } $content = file_get_contents($file); $this->assertFalse(strpos($content, $patternFailIfFound), "\146\x6f\x75\x6e\144\x20\151\156\40" . $file); } } public function getTemplateFileExtensions() { $extensions = array(array("\150\x74\155"), array("\x68\x74\155\x6c"), array("\164\167\151\x67"), array("\164\x70\x6c")); return $extensions; } public function testTemplatesDontContainJquery($extension) { $patternFailIfFound = "\152\x71\165\x65\162\171"; $allowedFiles = array(PIWIK_INCLUDE_PATH . "\x2f\160\154\165\x67\x69\x6e\163\x2f\x54\x65\x73\164\122\x75\156\156\145\x72\57\164\145\155\160\154\141\x74\x65\163\x2f\155\x61\164\157\x6d\x6f\55\x74\145\163\164\x73\56\171\155\x6c\56\x74\167\x69\x67", PIWIK_INCLUDE_PATH . "\x2f\x70\154\x75\x67\151\156\163\x2f\103\157\x72\x65\125\x70\x64\141\x74\145\x72\57\164\x65\155\160\x6c\x61\164\x65\163\x2f\154\x61\x79\157\x75\x74\56\x74\167\151\x67", PIWIK_INCLUDE_PATH . "\x2f\x70\154\165\147\x69\156\163\57\x49\x6e\x73\x74\x61\x6c\154\x61\x74\x69\157\x6e\x2f\164\x65\155\x70\154\x61\164\x65\163\57\154\141\171\x6f\x75\x74\56\164\167\151\x67", PIWIK_INCLUDE_PATH . "\x2f\x70\154\165\x67\151\156\x73\x2f\114\x6f\x67\151\x6e\57\164\145\x6d\x70\154\x61\164\145\x73\57\154\157\x67\x69\x6e\x4c\x61\171\x6f\x75\x74\56\x74\167\151\147", PIWIK_INCLUDE_PATH . "\x2f\160\x6c\x75\x67\151\156\163\57\x53\x45\117\x2f\164\145\163\x74\163\x2f\x72\x65\163\157\165\x72\x63\145\x73\57\x77\x68\x6f\x69\x73\x5f\x72\x65\x73\160\x6f\156\x73\x65\56\150\164\x6d\154", PIWIK_INCLUDE_PATH . "\57\160\x6c\x75\147\151\x6e\x73\x2f\123\105\117\x2f\x74\145\x73\x74\x73\x2f\162\145\x73\x6f\x75\x72\x63\145\163\x2f\167\x68\157\x69\163\x63\157\x6d\137\162\145\x73\x70\157\x6e\163\x65\56\x68\x74\155\154", PIWIK_INCLUDE_PATH . "\x2f\164\145\163\x74\163\x2f\x55\111\57\163\x63\x72\x65\x65\156\x73\x68\157\164\55\x64\x69\146\x66\163\57\163\x69\x6e\147\x6c\145\144\x69\146\x66\56\150\x74\x6d\x6c", PIWIK_INCLUDE_PATH . "\57\164\145\163\x74\163\x2f\x72\145\x73\157\165\162\x63\145\x73\57\x6f\x76\x65\x72\x6c\141\171\55\164\x65\163\164\x2d\163\151\164\145\55\x72\x65\x61\154\x2f", PIWIK_INCLUDE_PATH . "\x2f\164\145\x73\164\x73\x2f\162\145\x73\157\165\162\x63\x65\x73\57\157\x76\x65\162\154\141\x79\55\x74\145\x73\164\55\163\x69\x74\145\57", PIWIK_INCLUDE_PATH . "\57\x76\145\x6e\144\157\162\x2f\154\x6f\x78\57\x78\150\x70\x72\x6f\146\x2f\170\x68\160\162\x6f\x66\x5f\150\x74\x6d\x6c\57\144\157\143\163\57", PIWIK_INCLUDE_PATH . "\x2f\x76\x65\156\144\157\162\57\x70\x68\160\x75\156\151\164\57", PIWIK_INCLUDE_PATH . "\x2f\x70\154\165\x67\x69\x6e\163\x2f\115\157\162\160\x68\x65\165\163\x2f\x69\x63\157\156\163\x2f", PIWIK_INCLUDE_PATH . "\57\156\157\144\145\x5f\155\x6f\x64\x75\x6c\x65\163\57"); $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "\52\x2e" . $extension); $this->assertFilesDoNotContain($files, $patternFailIfFound, $allowedFiles); } private function assertFilesDoNotContain($files, $patternFailIfFound, $allowedFiles) { $foundPatterns = array(); foreach ($files as $file) { if ($this->isFileOrPathAllowed($allowedFiles, $file)) { continue; } $content = file_get_contents($file); $foundPattern = strpos($content, $patternFailIfFound) !== false; if ($foundPattern) { $foundPatterns[] = $file; } } $this->assertEmpty($foundPatterns, sprintf("\106\x6f\x72\x62\151\x64\x64\145\156\x20\x70\141\164\x74\145\162\156\40\x22\x25\163\42\x20\167\141\x73\x20\146\157\x75\156\144\40\x69\x6e\x20\164\x68\x65\40\x66\157\x6c\x6c\x6f\167\x69\156\147\40\x66\x69\154\x65\x73\40\x2d\55\x2d\x3e\x20\x70\x6c\145\x61\x73\145\40\x6d\x61\x6e\x75\x61\x6c\154\171\x20\x64\x65\x6c\x65\164\145\40\164\x68\x65\x73\x65\x20\x66\x69\154\145\x73\40\146\162\157\x6d\40\x47\x69\x74\56\40\12\12\11\x25\163", $patternFailIfFound, implode("\xa\x9", $foundPatterns))); } private function isFileOrPathAllowed($allowedFiles, $file) { foreach ($allowedFiles as $allowedFile) { if (strpos($file, $allowedFile) === 0) { return true; } } return false; } public function testCheckThatGivenPluginsAreDisabledByDefault() { $pluginsShouldBeDisabled = array("\104\x42\x53\164\x61\x74\163"); foreach ($pluginsShouldBeDisabled as $pluginName) { $this->assertNotContains($pluginName, $this->globalConfig["\120\x6c\165\147\x69\156\163"]["\x50\154\x75\x67\151\x6e\163"], "\120\x6c\165\147\151\x6e\x20{$pluginName}\x20\x69\x73\x20\x65\x6e\141\x62\x6c\x65\x64\40\142\171\x20\144\x65\146\x61\x75\x6c\164\x20\142\x75\164\x20\163\x68\x6f\165\x6c\144\x6e\x27\164\56"); } } public function testProfilingDisabledInProduction() { require_once "\x54\x72\x61\143\153\145\162\x2f\104\142\56\160\150\160"; $this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, "\x53\121\x4c\x20\160\162\x6f\x66\151\154\x65\162\40\x73\150\x6f\x75\154\x64\x20\x62\145\x20\144\151\x73\x61\x62\x6c\x65\x64\40\x69\x6e\x20\x70\x72\x6f\144\x75\x63\164\151\157\x6e\41\40\123\x65\145\x20\104\142\72\72\44\x70\162\x6f\x66\x69\154\151\156\x67"); } public function testPiwikTrackerDebugIsOff() { $this->assertTrue(!isset($GLOBALS["\120\x49\x57\111\113\137\124\x52\101\x43\x4b\105\x52\137\104\105\x42\125\107"])); $this->assertEquals(0, $this->globalConfig["\x54\162\x61\x63\153\x65\162"]["\144\145\142\165\x67"]); $tracker = new Tracker(); $this->assertFalse($tracker->isDebugModeEnabled()); } public function test_phpFilesStartWithRightCharacter() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "\x2a\x2e\x70\x68\x70"); $tested = 0; foreach ($files as $file) { if (strpos($file, "\x2f\154\x69\x62\x73\x2f") !== false) { continue; } $handle = fopen($file, "\162"); $expectedStart = "\74\77\x70\x68\160"; $isIniFile = strpos($file, "\56\151\x6e\x69\56\x70\x68\160") !== false; if ($isIniFile) { $expectedStart = "\73\40\x3c\x3f\160\150\x70\40\145\170\x69\x74\73"; } $skipStartFileTest = $this->isSkipPhpFileStartWithPhpBlock($file, $isIniFile); if ($skipStartFileTest) { continue; } $start = fgets($handle, strlen($expectedStart) + 1); $this->assertEquals($start, $expectedStart, "\106\151\x6c\145\x20{$file}\40\144\x6f\145\x73\40\156\x6f\x74\x20\163\164\141\162\x74\x20\167\x69\x74\150\x20{$expectedStart}"); $tested++; } $this->assertGreaterThan(2000, $tested, "\x73\150\157\165\154\144\40\150\141\x76\145\40\164\x65\163\164\x65\144\40\141\164\x20\154\x65\x61\x73\x74\x20\x74\150\x6f\165\163\141\x6e\x64\x20\157\x66\40\x20\160\x68\x70\x20\146\151\154\x65\163"); } public function test_jsfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "\x2a\56\x6a\x73"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_phpfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "\52\x2e\x70\150\160"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_twigfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "\52\x2e\x74\167\x69\147"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_htmlfilesDoNotContainFakeSpaces() { $js = Filesystem::globr(PIWIK_INCLUDE_PATH, "\x2a\x2e\x68\x74\x6d\x6c"); $this->checkFilesDoNotHaveWeirdSpaces($js); } public function test_directoriesShouldBeChmod755() { $pluginsPath = realpath(PIWIK_INCLUDE_PATH . "\57\x70\x6c\165\147\x69\x6e\163\x2f"); $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pluginsPath), RecursiveIteratorIterator::SELF_FIRST); $paths = array(); foreach ($objects as $name => $object) { if (is_dir($name) && strpos($name, "\x2f\x2e") === false) { $paths[] = $name; } } $this->assertGreaterThan(50, count($paths), "\x74\145\163\164\40\141\x74\x20\x6c\141\164\x65\x73\x74\x20\65\60\40\x64\x69\162\145\x63\x74\x6f\162\151\x65\163\54\x20\147\x6f\x74\x20" . count($paths)); foreach ($paths as $pathToTest) { $chmod = substr(decoct(fileperms($pathToTest)), -3); $valid = array("\x37\x37\x37", "\67\67\65", "\67\65\x35"); $command = "\146\151\x6e\x64\40{$pluginsPath}\40\x2d\164\171\x70\x65\40\x64\x20\55\145\170\145\x63\40\143\x68\155\157\x64\x20\67\65\65\40\173\x7d\40\x2b"; $this->assertTrue(in_array($chmod, $valid), "\123\157\155\x65\x20\144\x69\162\145\x63\x74\157\162\x69\x65\x73\40\x77\151\164\150\151\x6e\40\160\x6c\165\x67\151\156\163\57\x20\x61\162\145\40\x6e\157\164\40\143\x68\155\157\144\40\67\x35\65\x20\xa\12\x47\x6f\164\x3a\x20{$chmod}\x20\x66\x6f\x72\x20\72\x20{$pathToTest}\x20\xa\12" . "\122\165\x6e\x20\164\150\151\163\40\143\x6f\x6d\155\x61\x6e\144\x20\x74\x6f\x20\x73\145\x74\x20\x61\x6c\x6c\x20\x64\x69\x72\145\x63\x74\157\x72\151\145\163\40\164\x6f\40\67\65\x35\x3a\x20\12{$command}\12"); } } public function test_DirectoriesInPluginsFolder_areKnown() { $pluginsBundledWithPiwik = Config::getInstance()->getFromGlobalConfig("\x50\x6c\165\147\151\x6e\163"); $pluginsBundledWithPiwik = $pluginsBundledWithPiwik["\120\x6c\x75\147\x69\156\x73"]; $magicPlugins = 42; $this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins); $plugins = _glob(Manager::getPluginsDirectory() . "\52", GLOB_ONLYDIR); $count = 1; foreach ($plugins as $pluginPath) { $pluginName = basename($pluginPath); $addedToGit = $this->isPathAddedToGit($pluginPath); if (!$addedToGit) { continue; } $manager = Manager::getInstance(); $isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName); $pluginList = StaticContainer::get("\120\151\x77\151\153\x5c\x41\160\160\154\151\x63\x61\164\x69\x6f\x6e\134\113\145\x72\x6e\145\x6c\x5c\x50\154\165\147\x69\156\114\x69\x73\x74"); $disabled = in_array($pluginName, $pluginList->getCorePluginsDisabledByDefault()) || $isGitSubmodule; $enabled = in_array($pluginName, $pluginsBundledWithPiwik); $this->assertTrue($enabled + $disabled === 1, "\120\154\165\x67\x69\x6e\x20{$pluginName}\40\163\150\157\x75\x6c\x64\x20\142\145\x20\145\151\x74\x68\x65\162\40\145\156\141\x62\154\145\144\40\x28\x69\x6e\x20\147\x6c\157\x62\141\x6c\56\x69\156\151\x2e\160\x68\160\51\x20\157\x72\40\144\x69\x73\141\x62\x6c\x65\x64\x20\50\151\x6e\40\120\x69\x77\x69\x6b\134\x41\160\x70\x6c\x69\143\141\x74\x69\157\x6e\134\113\x65\x72\156\x65\x6c\x5c\x50\154\165\147\x69\x6e\x4c\x69\x73\x74\x29\56\xa\x20\40\40\x20\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\111\x74\x20\x69\x73\40\x63\165\162\162\x65\x6e\x74\154\x79\x20\50\145\x6e\x61\142\154\145\144\x3d" . (int) $enabled . "\54\x20\x64\151\163\x61\142\x6c\x65\x64\x3d" . (int) $disabled . "\x29"); $count++; } $this->assertTrue($count > $magicPlugins); } public function testEndOfLines() { foreach (Filesystem::globr(PIWIK_DOCUMENT_ROOT, "\x2a") as $file) { if (strpos($file, "\x2f\x2e\x67\151\164\57") !== false || strpos($file, "\x2f\x64\157\x63\165\155\145\x6e\x74\141\x74\x69\157\x6e\x2f") !== false || strpos($file, "\x2f\x74\145\x73\164\x73\57") !== false || strpos($file, "\57\x6c\141\156\x67\57") !== false || strpos($file, "\x79\165\x69\143\x6f\155\160\162\x65\x73\x73\157\x72") !== false || strpos($file, "\x2f\166\145\156\x64\157\x72") !== false && strpos($file, "\x2f\x76\145\x6e\x64\x6f\162\x2f\x70\x69\x77\151\x6b") === false || strpos($file, "\x2f\x74\x6d\160\x2f") !== false || strpos($file, "\57\156\157\144\x65\137\x6d\x6f\x64\x75\x6c\x65\163\x2f") !== false || strpos($file, "\x2f\115\x6f\162\x70\x68\x65\165\163\x2f\x69\x63\157\156\x73\x2f\163\162\x63\57") !== false || strpos($file, "\57\x70\x68\x61\156\x74\157\155\x6a\x73\57") !== false) { continue; } if (preg_match("\x2f\134\56\x28\155\155\144\x62\174\x62\155\x70\174\x66\144\146\174\147\151\146\x7c\x64\145\142\174\x64\x65\146\154\141\x74\x65\x7c\x65\170\145\x7c\x67\172\174\x69\x63\157\x7c\x6a\141\162\x7c\152\x70\x67\x7c\160\61\62\174\160\x64\x66\x7c\x70\156\147\x7c\x72\141\x72\x7c\163\167\x66\174\x76\163\144\x7c\x7a\174\172\x69\160\174\x74\164\x66\174\163\157\174\x64\141\164\174\145\x70\x73\174\160\150\x61\162\174\160\171\143\x7c\x67\x7a\151\x70\174\x65\x6f\164\174\167\157\x66\x66\174\163\x76\147\x7c\167\x6f\x66\146\62\51\44\57", $file)) { continue; } if (!is_dir($file)) { $contents = file_get_contents($file); if (preg_match("\57\134\x2e\50\x62\141\x74\174\160\163\61\x29\44\57", $file)) { $contents = str_replace("\xd\12", '', $contents); $this->assertTrue(strpos($contents, "\12") === false, "\x49\x6e\x63\x6f\162\x72\145\143\164\x20\x6c\151\156\145\x20\x65\x6e\144\x69\156\x67\163\40\x69\156\40" . $file); } else { $hasWindowsEOL = strpos($contents, "\xd\12"); $this->assertTrue($hasWindowsEOL === false, "\111\x6e\x63\157\162\x72\x65\x63\x74\40\154\x69\156\145\x20\x65\x6e\x64\x69\x6e\147\163\x20\134\x72\x5c\156\40\x66\157\x75\x6e\x64\x20\x69\156\40" . $file); } } } } public function testPiwikJavaScript() { $pattern = "\x2f\134\x78\x35\x62\x5c\170\x35\x63\173\62\x7d\56\52\x5c\x78\x35\143\x7b\62\x7d\x5b\134\x78\62\x32\x5c\170\62\x37\x5d\x2f"; $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . "\57\152\x73\57\x70\x69\167\151\153\x2e\x6a\x73"); $this->assertTrue(preg_match($pattern, $contents) == 0); $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . "\x2f\160\x69\167\x69\153\56\x6a\163"); $this->assertTrue(preg_match($pattern, $contents) == 0); } public function test_piwikJs_minified_isUpToDate() { shell_exec("\x73\x65\x64\x20\47\x2f\74\x44\x45\x42\x55\107\76\57\x2c\57\x3c\134\x2f\x44\105\x42\x55\107\76\x2f\144\47\40\x3c\x20" . PIWIK_DOCUMENT_ROOT . "\x2f\152\163\x2f\x70\151\x77\151\x6b\56\x6a\163\40\x7c\40\163\145\x64\x20\x27\x73\x2f\x65\x76\141\x6c\57\x72\x65\x70\154\141\143\145\x64\x45\x76\151\x6c\123\164\162\x69\x6e\147\x2f\x27\x20\x7c\40\x6a\141\x76\x61\40\x2d\152\141\x72\x20" . PIWIK_DOCUMENT_ROOT . "\x2f\x74\145\163\x74\x73\x2f\162\x65\163\157\x75\162\143\145\163\57\x79\x75\151\143\157\155\x70\162\x65\x73\163\157\162\57\x79\x75\151\x63\157\x6d\160\162\145\163\x73\x6f\162\x2d\x32\56\64\x2e\x38\56\152\141\x72\x20\55\x2d\x74\x79\160\145\x20\x6a\x73\x20\55\x2d\154\x69\156\x65\55\142\162\145\141\x6b\x20\61\60\60\x30\40\174\40\163\145\144\40\47\163\x2f\x72\x65\160\x6c\141\x63\145\144\x45\166\151\x6c\x53\x74\162\151\156\x67\x2f\145\166\x61\154\57\47\40\174\40\163\145\144\40\x27\163\57\x5e\x5b\57\135\x5b\52\x5d\57\134\57\52\x21\x2f\x27\x20\x3e\40" . PIWIK_DOCUMENT_ROOT . "\57\x70\x69\167\151\153\x2d\155\151\156\x69\x66\151\145\x64\56\152\163"); $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "\57\x70\x69\167\x69\x6b\55\155\151\x6e\151\x66\151\145\x64\x2e\x6a\x73", PIWIK_DOCUMENT_ROOT . "\57\x70\x69\x77\x69\153\x2e\x6a\x73", "\x6d\x69\156\x69\146\151\145\x64\x20\57\x70\x69\167\151\x6b\56\152\x73\x20\151\163\40\157\165\x74\40\157\x66\40\144\141\164\x65\x2c\x20\160\154\145\141\163\x65\x20\x72\x65\x2d\x67\145\x6e\x65\162\141\x74\x65\x20\164\x68\x65\40\x6d\151\x6e\x69\146\x69\145\x64\x20\x66\x69\x6c\x65\163\40\x75\163\x69\156\147\x20\x69\156\x73\164\x72\165\143\164\151\x6f\156\163\40\x69\x6e\x20\57\x6a\163\57\122\x45\101\x44\115\105"); $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "\x2f\160\x69\167\x69\153\x2d\x6d\151\156\x69\x66\151\x65\x64\56\152\163", PIWIK_DOCUMENT_ROOT . "\x2f\x6a\x73\x2f\x70\151\x77\151\153\x2e\x6d\151\156\x2e\152\163", "\x6d\x69\x6e\151\x66\x69\x65\x64\x20\57\152\163\x2f\160\151\167\151\x6b\x2e\155\151\x6e\56\152\x73\x20\x69\x73\40\157\165\164\x20\x6f\x66\x20\144\x61\x74\145\x2c\x20\x70\x6c\145\141\163\145\40\x72\x65\55\147\x65\156\145\x72\141\164\x65\40\164\x68\x65\x20\155\151\x6e\x69\146\151\145\x64\x20\146\x69\x6c\x65\x73\x20\x75\x73\151\156\x67\x20\x69\156\163\164\162\165\143\x74\x69\157\x6e\163\40\151\x6e\40\x2f\152\x73\x2f\122\x45\x41\x44\115\x45"); } public function test_piwikJs_SameAsMatomoJs() { $this->assertFileEquals(PIWIK_DOCUMENT_ROOT . "\x2f\x6d\141\x74\x6f\155\157\56\x6a\163", PIWIK_DOCUMENT_ROOT . "\x2f\160\x69\x77\151\153\56\x6a\x73", "\57\x70\x69\167\x69\153\x2e\152\163\x20\144\157\145\163\x20\x6e\157\164\40\155\x61\164\x63\x68\40\57\x6d\x61\x74\x6f\x6d\x6f\x2e\x6a\163\x2c\x20\x70\x6c\145\141\163\145\40\162\145\55\x67\x65\x6e\x65\162\x61\164\145\x20\164\x68\x65\40\x6d\151\156\x69\146\x69\145\x64\x20\146\151\x6c\x65\163\40\165\163\x69\156\x67\40\151\x6e\x73\164\162\x75\x63\164\x69\x6f\156\163\40\151\x6e\x20\57\152\163\x2f\122\x45\x41\x44\x4d\105"); } public function testTmpDirectoryContainsGitKeep() { $this->assertFileExists(PIWIK_DOCUMENT_ROOT . "\x2f\x74\x6d\x70\57\x2e\x67\151\164\x6b\x65\x65\160"); } private function checkFilesAreInPngFormat($files) { $this->checkFilesAreInFormat($files, "\160\156\147"); } private function checkFilesAreInJpgFormat($files) { $this->checkFilesAreInFormat($files, "\x6a\x70\145\147"); } private function checkFilesAreInGifFormat($files) { $this->checkFilesAreInFormat($files, "\147\151\146"); } private function checkFilesAreInFormat($files, $format) { self::expectNotToPerformAssertions(); $errors = array(); foreach ($files as $file) { if (strpos($file, "\57\x6c\151\x62\163\x2f") !== false) { continue; } $function = "\151\155\141\x67\x65\x63\x72\x65\x61\x74\145\x66\x72\x6f\x6d" . $format; if (!function_exists($function)) { throw new \Exception("\125\156\x65\x78\x70\145\x63\x74\145\144\40\x65\162\162\x6f\162\x3a\40{$function}\40\146\165\156\143\x74\x69\157\x6e\x20\144\x6f\145\163\40\x6e\x6f\x74\x20\x65\x78\x69\x73\x74\x21"); } $handle = @$function($file); if (empty($handle)) { $errors[] = $file; } } if (!empty($errors)) { $icons = implode("\x20", $errors); $this->fail("{$format}\x20\x66\157\162\x6d\141\164\40\x66\141\x69\154\145\144\40\x66\157\x72\x20\146\x6f\154\154\157\x77\x69\x6e\147\x20\x69\x63\x6f\156\163\x20{$icons}\x20\xa"); } } protected function isSkipPhpFileStartWithPhpBlock($file, $isIniFile) { $isIniFileInTests = strpos($file, "\x2f\164\x65\163\164\x73\57") !== false; $isTestResultFile = strpos($file, "\57\123\x79\x73\x74\145\x6d\x2f\145\170\x70\145\x63\164\x65\144") !== false || strpos($file, "\164\145\x73\x74\163\x2f\162\x65\x73\x6f\x75\162\x63\145\163\57\125\x70\144\x61\164\x65\x72\57") !== false || strpos($file, "\124\167\x69\147\57\x54\145\x73\164\163\57") !== false || strpos($file, "\160\162\157\143\145\163\x73\x65\x64\57") !== false || strpos($file, "\57\166\145\x6e\144\x6f\162\x2f") !== false || strpos($file, "\164\x6d\x70\x2f") !== false && strpos($file, "\151\x6e\144\145\x78\x2e\160\150\x70") !== false; $isLib = strpos($file, "\x6c\151\x62\57\x78\150\x70\x72\x6f\146") !== false || strpos($file, "\160\x68\x70\x75\156\x69\x74\x2f\x70\150\160\x75\156\x69\x74") !== false; return $isIniFile && $isIniFileInTests || $isTestResultFile || $isLib; } protected function isPathAddedToGit($pluginPath) { $gitOutput = shell_exec("\147\x69\x74\x20\154\163\x2d\x66\151\x6c\145\x73\40" . $pluginPath . "\40\x2d\x2d\x65\x72\x72\x6f\x72\55\x75\156\x6d\x61\164\143\x68\x20\62\x3e\x26\x31"); $addedToGit = strlen($gitOutput) > 0 && strpos($gitOutput, "\x65\x72\x72\x6f\x72\x3a\40\160\141\x74\x68\x73\160\x65\143") === false; return $addedToGit; } public function test_TotalPiwikFilesSize_isWithinReasonnableSize() { if (!SystemTestCase::isCIEnvironment()) { $this->markTestSkipped("\x53\x6b\151\160\x70\145\144\x20\x74\150\x69\163\x20\164\145\x73\164\x20\157\156\40\154\157\143\x61\x6c\x20\x64\145\x76\40\145\x6e\x76\x69\x72\157\156\155\145\x6e\x74\x2e"); } $maximumTotalFilesizesExpectedInMb = 62; $minimumTotalFilesizesExpectedInMb = 38; $minimumExpectedFilesCount = 7000; $filesizes = $this->getAllFilesizes(); $sumFilesizes = array_sum($filesizes); $filesOrderedBySize = $filesizes; arsort($filesOrderedBySize); $this->assertLessThan($maximumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, sprintf("\x53\165\x6d\40\157\x66\x20\x61\x6c\154\40\x66\151\154\145\x73\x20\x73\x68\x6f\165\x6c\144\40\142\x65\40\x6c\x65\163\163\40\164\150\x61\156\40{$maximumTotalFilesizesExpectedInMb}\x20\115\142\56\12\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\12\x47\x6f\164\x20\x74\x6f\164\x61\x6c\x20\x66\151\x6c\145\40\x73\151\172\145\x73\40\157\146\72\40\45\144\40\x4d\x62\x2e\xa\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\12\x42\151\x67\147\x65\163\164\40\146\151\154\x65\163\x3a\40\45\163", $sumFilesizes / 1024 / 1024, var_export(array_slice($filesOrderedBySize, 0, 100, $preserveKeys = true), true))); $this->assertGreaterThan($minimumExpectedFilesCount, count($filesizes), "\105\x78\160\x65\143\x74\145\x64\x20\x61\164\x20\x6c\145\141\163\164\x20{$minimumExpectedFilesCount}\40\146\x69\154\x65\x73\40\163\150\157\x75\154\x64\40\142\x65\40\x69\156\x63\154\x75\144\145\144\40\x69\156\40\120\x69\x77\x69\x6b\56"); $this->assertGreaterThan($minimumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, "\x65\x78\x70\145\x63\164\145\144\x20\x74\157\40\150\141\x76\145\x20\141\164\40\154\x65\x61\x73\x74\40{$minimumTotalFilesizesExpectedInMb}\40\x4d\142\x20\157\x66\x20\146\151\x6c\145\163\40\151\x6e\40\120\151\x77\151\x6b\40\x63\157\x64\145\142\x61\163\x65\x2e"); } public function test_noUpdatesInCorePlugins() { $manager = Manager::getInstance(); $plugins = $manager->loadAllPluginsAndGetTheirInfo(); $pluginsWithUnexpectedUpdates = array(); $pluginsWithUpdates = array(); $numTestedCorePlugins = 0; $corePluginsThatAreIndependent = array("\124\141\x67\115\x61\x6e\x61\147\145\x72", "\120\162\x6f\166\151\144\145\162", "\103\x75\x73\x74\157\155\x56\141\x72\x69\141\142\154\145\163"); foreach ($plugins as $pluginName => $info) { if ($manager->isPluginBundledWithCore($pluginName) && !in_array($pluginName, $corePluginsThatAreIndependent)) { $numTestedCorePlugins++; $pathToUpdates = Manager::getPluginDirectory($pluginName) . "\57\125\x70\x64\141\x74\x65\x73\57\x2a\56\x70\x68\160"; $files = _glob($pathToUpdates); if (empty($files)) { $files = array(); } foreach ($files as $file) { $fileVersion = basename($file, "\x2e\x70\150\x70"); if (version_compare("\x33\56\x31\63\x2e\x30", $fileVersion) != 1) { $pluginsWithUnexpectedUpdates[$pluginName] = $file; } else { $pluginsWithUpdates[] = $pluginName; } } } } $this->assertSame(array(), $pluginsWithUnexpectedUpdates); $this->assertGreaterThan(50, $numTestedCorePlugins); $this->assertSame(array("\x43\165\163\164\157\155\x44\x69\155\145\x6e\163\151\157\x6e\x73", "\104\145\166\x69\x63\145\163\104\145\x74\145\x63\164\151\157\x6e", "\x45\170\141\x6d\160\154\145\120\154\165\x67\x69\x6e", "\107\x6f\x61\154\x73", "\114\x61\156\147\x75\x61\x67\x65\x73\x4d\x61\x6e\x61\147\145\162"), array_values(array_unique($pluginsWithUpdates))); } public function test_bowerComponentsBc_referencesFilesThatExists() { $filesThatDoNotExist = array(); foreach (UIAssetFetcher::$bowerComponentFileMappings as $oldFile => $newFile) { if ($newFile && !file_exists(PIWIK_DOCUMENT_ROOT . "\x2f" . $newFile)) { $filesThatDoNotExist[] = $newFile; } } $this->assertEmpty($filesThatDoNotExist, "\x54\x68\x65\x20\x66\157\x6c\x6c\157\167\x69\156\147\40\141\x73\x73\145\164\x20\146\x69\x6c\145\x73\x20\151\156\40\x55\x49\101\x73\163\x65\x74\x46\x65\x74\143\x68\x65\162\72\72\44\142\x6f\167\145\x72\103\x6f\155\x70\157\x6e\145\x6e\x74\x46\x69\154\145\115\x61\x70\x70\151\x6e\x67\x73\x20\144\x6f\40\156\157\x74\x20\x65\170\x69\x73\x74\x3a\40" . implode("\x2c\x20", $filesThatDoNotExist)); } public function test_noVueHtmlWithoutSanitize() { $command = "\x67\x72\x65\160\40\55\162\x20\42\x76\55\x68\x74\x6d\154\x3d\42\40" . PIWIK_INCLUDE_PATH . "\57\x70\154\165\x67\x69\156\163\x20\x2d\55\151\156\x63\x6c\165\x64\x65\x3d\52\56\x76\165\145\40\x7c\x20\x67\x72\x65\160\40\x2d\166\x20\x22\166\x2d\x68\164\x6d\x6c\x3d\133\47\134\x22\x5d\134\x24\x73\x61\156\x69\164\x69\172\145\x22"; $output = shell_exec($command); $errorMessage = ''; if (!empty($output)) { $lines = explode("\xa", $output); $files = array(); foreach ($lines as $line) { if (empty(trim($line))) { continue; } list($file, $match) = explode("\72", $line); $files[] = "\55\x20" . trim($file); } $errorMessage = "\x46\157\165\156\144\40\165\x73\x65\163\40\x6f\x66\x20\x76\55\x68\164\x6d\x6c\x20\x77\x69\x74\150\157\x75\164\40\44\163\x61\156\151\x74\x69\x7a\145\72\12" . implode("\12", $files); } $this->assertEmpty($output, $errorMessage); } private function isFileIncludedInFinalRelease($file) { if (is_dir($file)) { return false; } if ($this->isFileBelongToTests($file)) { return false; } if (strpos($file, PIWIK_INCLUDE_PATH . "\57\x74\155\x70\x2f") !== false) { return false; } if ((strpos($file, "\107\x65\157\x49\120") !== false || strpos($file, "\x44\x42\111\x50") !== false) && strpos($file, "\x2e\x6d\x6d\144\x62") !== false) { return false; } if ($this->isFileIsAnIconButDoesNotBelongToDistribution($file)) { return false; } if ($this->isPluginSubmoduleAndThereforeNotFoundInFinalRelease($file)) { return false; } if ($this->isFileBelongToComposerDevelopmentPackage($file)) { return false; } if ($this->isFileDeletedFromPackage($file)) { return false; } return true; } private function isPluginSubmoduleAndThereforeNotFoundInFinalRelease($file) { if (strpos($file, PIWIK_INCLUDE_PATH . "\x2f\160\x6c\x75\x67\151\x6e\163\x2f") === false) { return false; } $pluginName = str_replace(PIWIK_INCLUDE_PATH . "\x2f\x70\x6c\165\x67\x69\156\163\x2f", '', $file); $pluginName = substr($pluginName, 0, strpos($pluginName, "\x2f")); $this->assertNotEmpty($pluginName, "\104\x65\164\145\143\164\x65\144\40\x61\x6e\x20\x65\155\160\164\171\x20\x70\154\x75\x67\x69\156\40\156\141\155\145\x20\146\x72\157\155\x20\160\141\164\x68\72\x20{$file}\40"); $pluginManager = Manager::getInstance(); $notInPackagedRelease = $pluginManager->isPluginOfficialAndNotBundledWithCore($pluginName); if ($pluginName == "\x56\151\x73\x69\164\157\x72\107\x65\156\x65\x72\141\x74\x6f\162") { $this->assertTrue($notInPackagedRelease, "\105\170\x70\145\x63\164\x65\144\x20\151\x73\120\154\165\147\x69\x6e\117\146\x66\x69\143\x69\x61\154\101\x6e\144\116\157\x74\x42\165\x6e\x64\x6c\x65\144\x57\151\x74\x68\103\157\x72\x65\40\x74\157\40\162\145\164\x75\162\156\40\164\x72\x75\145\x20\146\x6f\162\40\x56\151\163\x69\x74\157\162\x47\x65\x6e\x65\x72\141\x74\157\162\x20\160\x6c\x75\x67\x69\x6e"); } return $notInPackagedRelease; } private function isFileBelongToComposerDevelopmentPackage($file) { $composerDependencyDevOnly = $this->getComposerRequireDevPackages(); return $this->isFilePathFoundInArray($file, $composerDependencyDevOnly); } private function getComposerRequireDevPackages() { $composerJson = $this->getComposerLockAsArray(); $composerDependencyDevOnly = array_column($composerJson["\160\x61\143\153\x61\x67\145\163\55\x64\x65\166"], "\x6e\x61\x6d\145"); return $composerDependencyDevOnly; } private function isFilePathFoundInArray($file, $filesToMatchAgainst) { foreach ($filesToMatchAgainst as $fileToMatchAgainst) { if (strpos($file, $fileToMatchAgainst) !== false || fnmatch(PIWIK_INCLUDE_PATH . "\x2f" . $fileToMatchAgainst, $file)) { return true; } } return false; } private function isFileDeletedFromPackage($file) { $filesAndFoldersToDeleteFromPackage = array("\143\x6f\155\160\157\163\x65\162\56\x70\x68\x61\162", "\x76\x65\x6e\144\x6f\x72\x2f\x62\151\156\57", "\166\x65\x6e\x64\x6f\162\x2f\143\157\156\164\141\x69\x6e\145\162\55\x69\156\x74\145\162\x6f\x70\x2f\143\157\156\164\x61\151\x6e\145\x72\55\151\156\x74\145\x72\157\x70\57\144\157\143\x73", "\166\x65\156\144\157\x72\x2f\x64\x61\166\x61\x78\x69\x2f\163\x70\x61\x72\x6b\154\x69\x6e\145\57\143\x6f\x6d\x70\x6f\163\145\162\x2d\70\56\x6a\x73\157\156", "\x76\145\x6e\144\157\162\57\x64\x61\166\x61\170\151\x2f\163\160\141\162\x6b\x6c\x69\x6e\x65\57\144\157\x63\x6b\x65\162\55\x63\x6f\155\160\x6f\163\x65\56\x79\x6d\x6c", "\x76\145\x6e\x64\x6f\162\x2f\144\141\x76\141\x78\x69\x2f\163\160\x61\x72\153\x6c\151\x6e\145\57\x44\x6f\x63\x6b\x65\162\146\x69\x6c\x65", "\166\x65\156\x64\x6f\x72\57\x67\145\157\x69\160\x32\x2f\147\145\157\151\x70\x32\x2f\145\x78\x61\155\x70\x6c\x65\x73\57", "\x76\145\156\144\157\x72\x2f\x6c\157\x78\x2f\x78\x68\x70\x72\157\x66\x2f\142\x69\x6e", "\166\145\156\x64\x6f\x72\x2f\154\157\170\57\170\x68\160\162\x6f\x66\57\x65\x78\141\x6d\x70\154\145\163", "\x76\x65\156\144\x6f\x72\57\154\x6f\x78\57\170\150\160\162\157\x66\57\x73\x63\162\151\160\164\x73", "\166\145\x6e\144\x6f\x72\57\154\157\x78\57\x78\150\x70\162\x6f\x66\x2f\145\x78\x74\145\156\x73\151\x6f\156", "\166\145\x6e\144\157\x72\57\154\157\170\57\x78\x68\160\x72\157\146\x2f\170\150\160\x72\x6f\146\137\150\x74\x6d\154", "\166\x65\156\144\157\162\x2f\155\x61\x78\x6d\151\156\144\x2d\144\x62\57\162\x65\x61\x64\145\x72\x2f\x65\170\164\x2f", "\166\145\x6e\x64\157\x72\x2f\x6d\141\x78\x6d\x69\156\144\55\x64\142\x2f\x72\145\x61\144\x65\162\57\141\x75\164\157\x6c\x6f\141\x64\56\160\x68\x70", "\x76\145\156\144\x6f\162\x2f\x6d\141\170\155\151\156\144\x2d\144\x62\57\162\x65\x61\144\145\162\57\x43\x48\x41\116\x47\105\x4c\117\107\56\x6d\x64", "\x76\x65\x6e\x64\x6f\162\57\155\141\170\155\151\156\144\57\x77\145\142\55\x73\x65\162\x76\x69\143\x65\55\x63\x6f\x6d\x6d\157\156\57\144\x65\166\x2d\142\151\156\57", "\x76\145\x6e\144\x6f\x72\x2f\x6d\141\x78\x6d\151\x6e\x64\x2f\x77\145\x62\55\163\145\x72\x76\151\143\x65\55\x63\157\155\x6d\157\x6e\57\x43\x48\x41\116\107\x45\x4c\x4f\107\56\x6d\144", "\x76\145\156\144\x6f\162\57\160\145\x61\162\x2f\x61\x72\x63\150\x69\x76\145\x5f\164\141\x72\x2f\144\x6f\x63\x73", "\x76\x65\156\144\x6f\162\x2f\160\x68\x70\x2d\144\151\x2f\151\156\x76\x6f\153\x65\x72\57\144\x6f\x63\x2f", "\x76\x65\x6e\144\x6f\x72\x2f\x70\150\x70\x2d\144\151\x2f\x70\150\160\55\144\x69\57\x62\145\156\x63\x68\155\141\x72\153\x73\x2f", "\166\145\156\x64\x6f\162\57\x73\171\155\x66\x6f\156\x79\57\x63\157\x6e\x73\157\154\x65\x2f\123\171\x6d\146\x6f\x6e\x79\57\103\157\x6d\x70\157\x6e\x65\x6e\x74\x2f\103\157\x6e\163\157\154\x65\57\122\145\163\157\165\162\143\145\x73\x2f\142\151\x6e", "\166\145\x6e\x64\x6f\162\57\163\x7a\x79\x6d\141\x63\150\57\143\x2d\160\143\150\x61\x72\x74\x2f\x72\145\x73\157\165\162\143\145\x73\x2f\x64\157\143", "\166\x65\156\x64\x6f\x72\x2f\163\172\171\x6d\x61\143\x68\x2f\x63\55\160\x63\150\x61\162\x74\x2f\x63\157\166\145\x72\x61\147\x65\x2e\163\x68", "\x76\145\x6e\144\x6f\162\x2f\x73\x7a\x79\155\x61\x63\150\x2f\x63\55\160\143\150\x61\x72\x74\57\x63\x6f\144\x65\143\145\160\x74\151\157\x6e\56\171\155\x6c", "\x76\145\x6e\144\157\162\x2f\x74\x65\x63\x6e\x69\143\153\x63\x6f\155\x2f\x74\143\x70\x64\x66\57\145\170\141\155\160\x6c\145\x73", "\x76\145\x6e\144\157\x72\x2f\164\x65\143\x6e\x69\143\x6b\143\157\x6d\x2f\x74\143\x70\144\146\x2f\164\x6f\x6f\x6c\163", "\x76\x65\156\144\157\162\x2f\164\x65\143\x6e\x69\143\x6b\143\x6f\x6d\x2f\164\x63\160\144\146\57\x43\x48\101\x4e\107\x45\x4c\117\x47\56\x54\x58\x54", "\x76\145\156\x64\x6f\162\x2f\164\167\151\147\x2f\x74\167\x69\x67\x2f\x74\145\163\164\x2f", "\166\145\156\144\157\x72\x2f\164\167\151\147\57\164\167\151\147\x2f\144\157\x63\57", "\x76\145\x6e\x64\157\162\57\164\167\151\x67\57\164\x77\x69\x67\57\x2e\160\150\x70\55\x63\163\x2d\146\151\x78\x65\162\x2e\x64\151\x73\164\x2e\x70\x68\x70", "\x63\x6f\x6e\146\x69\x67\57\145\156\x76\x69\162\x6f\x6e\155\145\x6e\x74\57\164\145\x73\x74\x2e\x70\x68\x70", "\143\x6f\156\x66\151\147\57\x65\x6e\x76\x69\162\x6f\156\155\x65\156\164\57\x75\151\55\x74\x65\x73\164\x2e\160\150\x70", "\160\154\165\147\151\156\x73\x2f\52\57\143\x6f\156\x66\x69\x67\57\x74\x65\x73\x74\x2e\160\x68\x70", "\160\x6c\x75\147\x69\156\163\x2f\x2a\x2f\143\x6f\x6e\x66\151\147\x2f\x75\151\55\164\145\x73\164\x2e\x70\150\x70", "\160\x6c\x75\147\151\x6e\x73\x2f\115\157\162\x70\x68\145\x75\163\57\151\143\x6f\x6e\x73\57\x73\x72\x63\52", "\x70\154\x75\x67\151\x6e\163\x2f\115\157\x72\x70\x68\145\165\163\57\x69\x63\x6f\x6e\x73\57\164\x6f\x6f\x6c\163\x2a", "\160\x6c\165\x67\x69\x6e\x73\x2f\x4d\x6f\x72\x70\x68\145\165\163\57\x69\x63\157\156\x73\x2f\x66\154\141\147\x2d\x69\x63\x6f\x6e\x2d\143\x73\163\52", "\160\154\x75\147\151\156\x73\57\x4d\157\x72\x70\x68\x65\165\163\57\151\x63\157\x6e\163\57\163\x75\142\155\x6f\144\x75\x6c\145\x73\x2a", "\160\x6c\165\147\x69\x6e\163\x2f\115\157\162\x70\x68\145\x75\163\57\x69\x63\x6f\x6e\163\57\56\147\x69\x74\52", "\x70\154\x75\x67\151\156\x73\x2f\115\157\x72\x70\150\145\165\163\57\151\143\157\156\163\x2f\x2a\56\x70\171", "\160\x6c\165\147\151\x6e\163\57\115\x6f\x72\x70\150\145\165\163\x2f\151\x63\x6f\x6e\163\57\x2a\x2e\x73\150", "\x70\x6c\x75\x67\x69\x6e\x73\57\x4d\x6f\x72\x70\150\x65\x75\x73\57\151\143\x6f\x6e\163\x2f\x2a\56\x6a\x73\x6f\x6e", "\160\154\x75\x67\151\156\163\57\x4d\x6f\x72\x70\150\x65\165\163\x2f\151\x63\157\156\163\x2f\x2a\x2e\x6c\x6f\143\x6b", "\160\x6c\x75\x67\x69\156\163\57\115\x6f\x72\x70\x68\x65\165\x73\x2f\x69\x63\x6f\156\x73\x2f\x2a\56\x73\166\x67", "\x70\154\x75\x67\x69\156\163\x2f\115\x6f\x72\160\150\x65\x75\163\57\151\x63\x6f\156\x73\x2f\x2a\x2e\164\x78\x74", "\x70\154\x75\x67\x69\156\x73\57\115\157\x72\x70\x68\x65\x75\x73\x2f\151\x63\157\156\x73\x2f\52\x2e\x70\x68\x70", "\160\x6c\x75\147\x69\x6e\163\57\x4d\x6f\162\160\x68\145\x75\163\x2f\x69\x63\157\156\x73\57\x2a\56\171\x6d\154", "\x70\x6c\x75\147\x69\156\163\x2f\105\x78\141\x6d\160\x6c\x65\52", "\166\x65\x6e\x64\157\x72\57\164\145\143\156\x69\x63\x6b\143\157\x6d\57\x74\143\x70\x64\146\57\146\x6f\x6e\x74\163\x2f\141\145\x5f\x66\157\156\164\163\137\62\56\60", "\166\x65\156\144\x6f\x72\x2f\164\145\x63\x6e\151\x63\x6b\x63\x6f\x6d\x2f\164\x63\160\144\x66\57\146\157\x6e\x74\163\x2f\x64\145\x6a\141\166\x75\55\146\x6f\156\164\x73\55\x74\x74\x66\x2d\62\x2e\x33\63", "\166\145\156\144\x6f\x72\x2f\164\x65\143\156\x69\x63\x6b\x63\x6f\155\57\164\143\x70\x64\x66\57\x66\157\x6e\164\x73\x2f\144\x65\x6a\141\x76\x75\55\x66\x6f\156\164\x73\55\x74\164\x66\x2d\x32\56\x33\x34", "\x76\x65\x6e\x64\x6f\162\x2f\164\x65\143\156\x69\x63\153\143\x6f\x6d\x2f\164\x63\160\144\x66\57\146\x6f\x6e\164\x73\57\146\x72\145\x65\146\157\x6e\x74\55\62\60\x31\60\60\x39\61\x39", "\166\145\156\144\157\x72\57\x74\145\143\x6e\x69\x63\x6b\x63\157\155\57\164\143\x70\x64\x66\x2f\146\157\x6e\x74\x73\x2f\x66\162\x65\145\x66\157\x6e\x74\x2d\x32\60\61\62\x30\x35\x30\x33", "\166\145\x6e\144\x6f\162\57\x74\145\x63\156\151\143\x6b\143\157\155\x2f\164\143\x70\144\x66\x2f\x66\157\156\164\163\x2f\146\x72\x65\145\155\x6f\x6e\x2a", "\166\145\x6e\144\157\x72\x2f\x74\x65\143\156\151\143\153\x63\157\155\x2f\x74\x63\x70\x64\x66\57\x66\157\156\164\163\x2f\x63\x69\x64\x2a", "\x76\145\156\x64\x6f\x72\57\x74\x65\143\156\151\143\x6b\x63\x6f\x6d\x2f\x74\x63\160\x64\x66\x2f\146\x6f\x6e\x74\163\57\x63\157\x75\x72\151\145\x72\x2a", "\166\x65\156\144\x6f\x72\57\164\145\x63\x6e\151\143\x6b\143\x6f\x6d\x2f\164\x63\x70\144\x66\x2f\x66\157\x6e\x74\163\57\141\x65\146\x75\162\141\x74\52", "\x76\145\156\144\157\162\57\x74\145\x63\x6e\x69\x63\153\x63\157\x6d\57\164\143\160\x64\146\x2f\146\x6f\x6e\x74\x73\x2f\x64\145\x6a\141\166\x75\x73\x61\156\x73\x62\x2a", "\166\x65\156\x64\x6f\x72\57\164\145\x63\156\151\143\x6b\x63\157\x6d\57\164\143\160\x64\146\x2f\x66\157\156\164\163\x2f\x64\145\x6a\x61\x76\x75\x73\141\x6e\163\x69\52", "\166\145\156\x64\157\x72\x2f\x74\145\143\156\x69\143\x6b\143\157\155\x2f\x74\143\160\144\x66\57\146\x6f\x6e\x74\163\x2f\x64\x65\x6a\x61\166\165\x73\141\x6e\x73\x6d\157\156\157\52", "\x76\x65\156\144\x6f\162\57\164\145\x63\156\x69\x63\153\143\x6f\155\x2f\164\143\x70\144\146\x2f\x66\157\x6e\x74\163\x2f\144\x65\152\141\166\x75\163\x61\156\x73\x63\x6f\156\144\145\x6e\x73\x65\144\52", "\166\145\x6e\x64\157\x72\x2f\x74\x65\x63\156\x69\x63\x6b\x63\157\155\x2f\x74\143\x70\x64\146\x2f\x66\157\x6e\164\163\x2f\144\145\x6a\x61\x76\x75\x73\141\x6e\x73\145\170\x74\162\141\154\151\x67\150\164\52", "\x76\x65\x6e\x64\157\x72\x2f\x74\x65\143\x6e\x69\143\153\143\x6f\155\57\164\143\x70\144\146\x2f\146\157\156\164\163\x2f\144\145\x6a\141\166\x75\163\145\162\x69\x66\x2a", "\x76\145\156\144\x6f\x72\x2f\164\x65\x63\x6e\x69\143\x6b\143\x6f\x6d\57\164\143\x70\144\x66\x2f\x66\x6f\x6e\164\163\57\x66\162\145\145\163\x61\156\x73\151\52", "\166\145\156\x64\x6f\x72\57\x74\145\143\156\151\x63\x6b\x63\157\x6d\x2f\x74\x63\x70\x64\146\57\x66\157\156\164\163\x2f\x66\x72\x65\145\x73\141\x6e\163\142\52", "\x76\145\156\144\157\162\57\164\145\143\156\151\x63\153\143\157\x6d\57\x74\x63\x70\144\146\x2f\x66\157\156\164\x73\x2f\146\162\x65\145\x73\x65\x72\x69\x66\142\x2a", "\166\x65\156\144\x6f\x72\x2f\x74\145\x63\x6e\151\143\153\x63\157\155\57\x74\x63\160\144\x66\x2f\146\157\156\x74\x73\x2f\x66\162\x65\145\x73\145\x72\x69\146\x69\x2a", "\166\x65\x6e\144\x6f\x72\x2f\x74\145\143\156\151\143\153\x63\157\155\57\164\x63\160\144\x66\x2f\x66\157\x6e\x74\163\57\160\x64\146\x2a", "\166\145\x6e\x64\157\x72\x2f\164\x65\x63\156\151\x63\x6b\x63\157\155\x2f\x74\143\160\x64\x66\57\x66\x6f\156\164\163\57\x74\x69\x6d\145\x73\52", "\x76\x65\x6e\144\157\x72\x2f\164\x65\143\156\151\143\153\143\157\x6d\x2f\x74\143\x70\x64\146\x2f\x66\x6f\x6e\164\163\x2f\165\156\151\62\143\151\144\52", "\x76\145\156\144\x6f\162\57\x73\172\x79\155\141\143\150\57\143\x2d\x70\143\x68\x61\x72\x74\57\x72\145\163\x6f\x75\162\x63\x65\163\x2f\x66\157\156\164\x73\x2f\141\x64\166\x65\x6e\164\137\x6c\x69\147\150\x74\x2a", "\166\x65\x6e\x64\x6f\162\57\163\172\x79\x6d\141\143\150\x2f\143\55\160\143\150\141\162\x74\x2f\162\x65\x73\x6f\x75\162\143\x65\163\57\146\x6f\x6e\x74\163\x2f\x42\x65\x64\151\172\x65\x6e\x2a", "\x76\145\156\144\157\x72\57\x73\172\171\155\x61\x63\x68\x2f\143\x2d\160\143\x68\141\162\164\57\162\x65\x73\157\x75\x72\x63\x65\163\x2f\x66\157\156\x74\x73\x2f\x63\x61\154\x69\142\x72\151\x2a", "\x76\x65\156\x64\x6f\x72\x2f\x73\x7a\171\155\141\x63\150\x2f\143\55\x70\143\x68\x61\162\164\x2f\162\145\163\157\x75\x72\x63\x65\163\x2f\146\x6f\x6e\164\163\57\106\x6f\x72\x67\x6f\x74\x74\x65\52", "\166\x65\156\x64\x6f\162\x2f\x73\172\x79\155\x61\x63\150\57\143\x2d\x70\x63\150\x61\x72\164\x2f\x72\x65\x73\x6f\165\x72\x63\x65\163\57\146\x6f\156\x74\163\57\115\141\x6e\x6b\x53\141\x6e\x73\52", "\x76\145\x6e\144\157\162\57\x73\x7a\x79\155\x61\143\x68\x2f\x63\55\160\143\150\x61\162\x74\57\x72\145\163\157\165\x72\x63\145\x73\57\x66\157\156\164\x73\x2f\160\146\x5f\141\x72\155\141\x5f\x66\151\166\x65\x2a", "\x76\145\x6e\x64\157\x72\x2f\163\x7a\171\155\x61\143\150\57\x63\x2d\x70\143\150\x61\x72\x74\x2f\x72\x65\163\157\165\x72\143\x65\163\x2f\x66\x6f\x6e\x74\163\x2f\x53\151\x6c\x6b\163\x63\162\x65\x65\156\52", "\x76\145\x6e\x64\x6f\x72\57\163\x7a\x79\x6d\141\x63\150\x2f\143\55\160\143\150\141\162\x74\57\162\x65\x73\157\x75\x72\143\145\x73\57\146\157\156\x74\163\x2f\166\x65\x72\144\141\x6e\141\52", "\x6e\157\x64\x65\137\x6d\157\x64\x75\154\145\163\57\143\x68\x72\157\155\141\x2d\152\163\x2f\x4d\141\153\145\x66\151\154\145", "\x6e\157\x64\x65\x5f\155\157\144\165\154\145\163\57\143\x68\x72\x6f\155\141\x2d\x6a\x73\57\x63\150\x72\x6f\x6d\141\x2e\152\163", "\156\157\x64\145\x5f\155\157\x64\165\x6c\145\163\x2f\143\150\162\x6f\155\141\x2d\152\163\x2f\x64\157\x63", "\156\x6f\144\x65\137\x6d\157\x64\165\x6c\x65\163\57\x63\x68\162\157\155\141\x2d\152\x73\57\x72\145\141\x64\x6d\x65\x2e\155\144", "\x6e\x6f\x64\x65\x5f\x6d\x6f\144\x75\154\x65\x73\x2f\x63\x68\162\x6f\x6d\141\55\152\163\x2f\x73\x72\x63", "\x6e\157\144\x65\x5f\155\157\x64\165\x6c\145\x73\57\x63\150\162\157\x6d\x61\55\x6a\x73\57\164\145\163\164", "\x6e\x6f\144\145\x5f\155\x6f\x64\x75\154\x65\163\x2f\x69\x66\162\141\155\x65\x2d\162\145\163\151\172\145\162\x2f\152\163\x2f\151\146\x72\141\155\145\x52\x65\163\x69\172\145\162\x2e\143\157\156\x74\145\x6e\164\127\151\156\x64\x6f\167\56\152\x73", "\156\157\144\x65\137\155\x6f\144\x75\x6c\x65\x73\x2f\151\146\162\141\x6d\x65\55\x72\x65\x73\151\x7a\x65\162\57\x6a\x73\57\x69\x66\162\141\x6d\x65\122\145\163\x69\x7a\x65\x72\x2e\152\163", "\156\x6f\x64\x65\137\x6d\157\x64\x75\x6c\x65\163\x2f\x69\146\162\x61\155\145\55\162\x65\163\151\x7a\145\x72\57\163\162\143\x2f\151\145\x38\x2e\160\x6f\154\171\x66\151\154\x73\x2e\152\x73", "\156\x6f\x64\145\137\x6d\x6f\x64\165\154\x65\x73\x2f\x69\x66\162\x61\155\x65\55\x72\x65\163\x69\x7a\145\162\x2f\x73\x72\143\57\x69\x66\x72\x61\x6d\x65\122\145\x73\x69\x7a\x65\162\56\143\x6f\156\164\x65\156\x74\x57\x69\x6e\x64\157\167\x2e\x6a\x73", "\156\157\x64\x65\137\x6d\157\144\165\154\145\x73\57\x69\146\x72\141\x6d\x65\55\162\x65\163\x69\x7a\145\162\57\163\162\x63\57\x69\146\x72\x61\x6d\145\122\145\163\x69\x7a\145\x72\x2e\x6a\163", "\156\157\x64\x65\137\x6d\157\x64\x75\x6c\145\163\x2f\x69\x66\x72\141\155\145\55\x72\145\163\x69\x7a\145\x72\57\x74\145\x73\x74\55\155\141\x69\156\x2e\152\163", "\156\157\x64\145\x5f\155\x6f\x64\165\x6c\145\163\x2f\152\161\165\x65\162\x79\x2f\x64\151\163\x74\57\152\161\165\145\x72\171\56\x6a\x73", "\156\x6f\x64\145\137\x6d\157\144\x75\x6c\145\x73\57\152\x71\x75\x65\162\x79\x2f\x73\x72\143", "\x6e\x6f\x64\145\x5f\155\x6f\x64\x75\154\145\x73\57\x6a\161\165\x65\162\171\x2f\x65\x78\x74\x65\x72\156\x61\154", "\x6e\x6f\144\x65\x5f\x6d\157\x64\x75\x6c\145\x73\57\x6a\161\x75\x65\162\171\x2d\165\151\55\x64\x69\163\x74\x2f\143\x6f\155\160\x6f\x6e\145\x6e\x74\x2e\x6a\163\x6f\x6e", "\x6e\x6f\x64\x65\x5f\155\x6f\x64\x75\154\x65\163\x2f\152\x71\165\x65\162\171\55\165\151\55\x64\151\x73\x74\57\145\170\x74\x65\x72\x6e\x61\154", "\x6e\x6f\x64\145\x5f\x6d\x6f\144\x75\154\145\x73\x2f\x6a\161\x75\145\162\171\55\x75\151\x2d\144\151\x73\x74\57\151\155\x61\147\145\x73", "\156\x6f\x64\x65\137\x6d\157\x64\165\x6c\x65\163\57\152\x71\165\x65\x72\171\55\165\x69\x2d\144\x69\x73\x74\57\151\x6e\144\145\170\56\150\x74\x6d\x6c", "\156\157\144\x65\137\x6d\157\x64\165\154\x65\x73\x2f\152\161\x75\x65\162\x79\x2d\165\151\x2d\x64\151\163\164\57\x6a\x71\x75\145\x72\x79\x2d\x75\x69\56\143\x73\163", "\156\157\144\145\137\155\157\144\x75\154\x65\163\x2f\x6a\x71\x75\145\x72\x79\55\165\x69\x2d\144\x69\x73\164\57\x6a\x71\x75\145\162\x79\55\165\151\x2e\152\163", "\x6e\x6f\x64\145\x5f\x6d\157\x64\x75\154\x65\x73\57\x6a\161\x75\x65\x72\171\x2d\165\151\x2d\x64\151\163\164\x2f\x6a\x71\x75\x65\x72\x79\x2d\165\151\56\x73\x74\162\x75\143\164\x75\162\145\x2e\x63\163\x73", "\x6e\157\144\x65\137\155\x6f\x64\x75\x6c\145\x73\x2f\x6a\x71\x75\145\162\x79\55\165\x69\55\144\x69\x73\164\57\152\x71\x75\x65\162\171\55\165\151\56\164\150\x65\x6d\x65\x2e\143\x73\x73", "\156\x6f\144\145\137\x6d\157\144\x75\154\145\x73\x2f\x6a\x71\x75\x65\x72\x79\56\144\x6f\x74\x64\x6f\164\144\x6f\164\x2f\x67\x75\x6c\x70\146\151\154\x65\x2e\152\x73", "\x6e\157\144\x65\137\155\x6f\144\x75\x6c\x65\163\x2f\x6a\161\165\145\162\171\56\144\x6f\x74\144\x6f\164\144\x6f\164\57\151\x6e\x64\x65\x78\56\x68\164\x6d\154", "\x6e\x6f\x64\145\137\x6d\157\x64\x75\154\x65\163\x2f\x6a\x71\x75\x65\162\171\56\x64\x6f\x74\x64\157\x74\144\157\164\x2f\144\157\x74\144\x6f\x74\144\157\164\56\152\x71\x75\x65\162\171\x2e\x6a\163\157\156", "\156\157\144\x65\137\x6d\157\x64\165\x6c\145\163\57\152\161\165\x65\x72\171\x2e\144\x6f\164\144\x6f\164\x64\x6f\164\57\163\x72\x63", "\x6e\x6f\x64\x65\x5f\x6d\x6f\144\x75\x6c\x65\x73\57\152\161\x75\145\x72\x79\56\163\x63\x72\x6f\154\x6c\164\157\57\152\161\165\x65\x72\171\56\163\143\x72\x6f\154\154\124\x6f\56\x6a\163", "\156\157\x64\x65\137\x6d\x6f\144\165\154\145\163\57\152\161\x75\x65\x72\x79\56\x73\143\162\x6f\x6c\x6c\164\x6f\57\163\x63\x72\x6f\x6c\x6c\x54\157\56\152\x71\x75\145\x72\171\56\x6a\163\157\x6e", "\156\x6f\144\145\137\x6d\x6f\x64\165\154\x65\x73\x2f\x6a\x71\165\145\162\171\56\163\143\162\157\x6c\154\164\157\x2f\143\x68\141\x6e\x67\x65\163\x2e\x74\x78\164", "\156\157\x64\145\137\x6d\157\x64\165\x6c\x65\163\57\152\161\165\x65\162\171\56\163\x63\162\x6f\x6c\154\164\157\57\x64\x65\155\157", "\156\x6f\x64\145\137\x6d\157\x64\x75\154\x65\163\x2f\100\155\141\164\145\162\x69\x61\x6c\x69\172\145\x63\x73\x73\x2f\x6d\x61\164\145\x72\151\x61\154\x69\x7a\x65\57\145\170\x74\162\141\163", "\x6e\157\x64\145\137\x6d\157\144\165\x6c\145\163\57\100\x6d\141\x74\x65\162\x69\x61\x6c\x69\x7a\x65\143\x73\x73\x2f\x6d\x61\164\x65\x72\151\141\x6c\x69\x7a\x65\57\x6a\163", "\x6e\x6f\144\145\x5f\x6d\x6f\144\x75\154\x65\163\x2f\100\155\x61\x74\145\x72\151\x61\x6c\x69\x7a\145\x63\x73\x73\x2f\155\x61\x74\145\x72\151\141\x6c\151\x7a\x65\57\x73\141\163\163", "\156\157\144\x65\137\155\x6f\x64\165\x6c\145\163\x2f\x40\x6d\141\x74\145\162\151\x61\154\151\172\x65\143\x73\163\57\155\x61\164\x65\162\151\x61\x6c\151\x7a\x65\x2f\x64\x69\x73\x74\57\x6a\x73\57\x6d\141\164\145\x72\151\141\154\151\172\145\x2e\152\x73", "\x6e\x6f\144\x65\x5f\x6d\157\144\165\154\x65\x73\x2f\100\155\x61\x74\145\162\x69\141\154\x69\172\145\x63\163\163\x2f\x6d\141\x74\x65\x72\151\141\154\151\172\x65\57\x64\x69\x73\164\57\143\163\x73\57\155\141\164\x65\x72\x69\141\x6c\151\x7a\x65\x2e\x63\x73\163", "\x6e\x6f\144\145\137\155\157\144\x75\154\x65\163\57\155\157\x75\x73\x65\x74\x72\141\x70\57\x6d\x6f\x75\x73\x65\x74\162\141\x70\56\x6a\163", "\156\157\x64\145\x5f\155\x6f\x64\x75\154\x65\x73\x2f\155\157\165\x73\x65\164\162\141\160\x2f\x70\x6c\165\x67\x69\x6e\x73", "\x6e\x6f\144\145\x5f\x6d\157\x64\165\154\x65\163\x2f\x6d\x6f\165\163\x65\164\162\x61\x70\x2f\155\x6f\165\x73\145\164\x72\x61\x70\56\163\165\142\154\x69\155\x65\55\160\162\157\x6a\x65\x63\164", "\156\x6f\x64\x65\x5f\x6d\x6f\x64\x75\x6c\145\163\57\x6e\147\55\144\x69\x61\x6c\157\147\57\103\x4f\x4e\124\122\x49\x42\125\x54\x49\x4e\107\x2e\155\144", "\156\157\x64\x65\x5f\x6d\157\x64\x75\x6c\145\163\x2f\156\147\x2d\x64\x69\x61\x6c\157\x67\57\143\163\163", "\156\157\144\145\x5f\x6d\157\144\x75\x6c\145\163\57\x6e\x67\55\x64\x69\141\154\157\x67\x2f\145\170\141\155\160\x6c\145", "\x6e\x6f\144\x65\x5f\155\x6f\144\165\154\145\163\x2f\x6e\147\55\x64\x69\141\154\x6f\x67\57\160\x72\x6f\x74\x72\x61\143\x74\157\162\56\x63\x6f\x6e\x66\x2e\x6a\x73", "\156\x6f\144\145\x5f\x6d\x6f\x64\165\x6c\x65\163\57\x6e\x67\x2d\x64\151\x61\154\x6f\147\x2f\x73\x65\162\166\145\x72\x2e\x6a\163", "\156\157\x64\x65\137\155\x6f\144\165\154\145\x73\57\161\x72\x63\157\144\x65\x6a\163\x32\57\151\x6e\x64\145\x78\x2d\x73\x76\147\56\x68\164\x6d\x6c", "\156\157\144\145\x5f\155\x6f\144\165\154\145\163\x2f\161\x72\143\x6f\144\145\x6a\x73\x32\x2f\x69\x6e\x64\145\x78\x2e\150\x74\x6d\154", "\156\x6f\x64\x65\137\155\157\144\x75\x6c\145\x73\x2f\x71\162\x63\157\144\x65\152\x73\x32\57\x69\x6e\x64\145\x78\56\163\x76\x67", "\156\157\x64\145\x5f\x6d\x6f\x64\x75\154\x65\x73\57\x71\162\143\x6f\144\x65\152\163\62\57\x6a\x71\x75\145\x72\171\x2e\x6d\x69\156\x2e\x6a\x73", "\156\157\144\x65\x5f\155\157\144\x75\x6c\x65\x73\x2f\x71\162\143\x6f\x64\145\152\163\x32\x2f\x71\162\143\157\x64\x65\x2e\x6a\x73", "\156\157\x64\x65\x5f\155\x6f\x64\x75\154\145\163\57\x73\160\162\151\156\164\146\x2d\x6a\x73\x2f\x43\x4f\x4e\x54\122\x49\x42\125\x54\117\122\123\56\115\x44", "\x6e\x6f\x64\x65\137\155\157\x64\165\154\x65\163\57\163\160\162\x69\x6e\x74\146\x2d\x6a\163\57\x52\105\101\x44\115\105\x2e\155\144", "\x6e\x6f\x64\x65\x5f\155\157\x64\x75\154\x65\x73\x2f\163\160\162\151\156\164\x66\x2d\x6a\163\x2f\163\162\143", "\x6e\157\x64\145\137\x6d\x6f\144\165\x6c\x65\163\57\166\x69\x73\151\x62\151\x6c\x69\164\x79\152\x73\57\x43\x68\x61\x6e\x67\145\x4c\157\x67\x2e\155\x64", "\156\x6f\x64\145\x5f\x6d\x6f\144\x75\154\x65\163\57\166\x69\x73\151\142\x69\x6c\151\164\x79\x6a\163\57\x63\x6f\155\160\x6f\x6e\x65\156\x74\56\x6a\x73\157\156", "\156\x6f\144\x65\137\x6d\x6f\x64\165\x6c\145\163\x2f\x76\151\163\151\142\x69\154\x69\164\171\152\163\57\x69\156\x64\x65\170\x2e\x64\56\164\x73", "\x6e\157\x64\145\137\x6d\x6f\x64\x75\154\x65\163\57\x76\x69\163\151\x62\x69\x6c\x69\x74\x79\x6a\x73\57\151\156\144\145\x78\x2e\152\163", "\x6e\x6f\x64\145\137\x6d\x6f\x64\x75\x6c\145\x73\57\166\x69\163\151\x62\151\x6c\151\x74\171\152\x73\57\x52\x45\101\x44\x4d\105\56\155\144", "\156\157\144\145\137\x6d\157\144\x75\154\145\163\57\166\165\145\x2f\x64\x69\163\x74\57\166\x75\145\x2e\x63\x6a\163\56\x6a\x73", "\156\157\x64\145\x5f\155\157\x64\165\154\145\163\57\166\165\145\x2f\144\x69\163\x74\x2f\x76\x75\145\x2e\143\x6a\163\56\x70\162\157\x64\x2e\x6a\163", "\156\157\x64\x65\x5f\155\157\144\165\x6c\x65\x73\57\x76\165\145\x2f\x64\x69\x73\x74\x2f\x76\x75\x65\56\x64\56\x74\x73", "\156\x6f\144\145\137\x6d\x6f\144\165\x6c\x65\x73\57\x76\x75\145\57\144\x69\163\x74\x2f\166\165\x65\56\x65\x73\155\55\142\x72\x6f\167\163\145\x72\56\x6a\x73", "\x6e\x6f\x64\x65\137\155\x6f\144\165\154\145\x73\x2f\166\165\145\57\x64\151\x73\164\x2f\x76\x75\145\56\x65\163\x6d\x2d\142\162\x6f\x77\x73\145\162\x2e\x70\162\157\144\56\152\x73", "\x6e\157\x64\x65\137\x6d\157\144\x75\x6c\x65\163\x2f\166\165\x65\57\x64\x69\x73\164\x2f\166\165\145\x2e\x65\x73\x6d\55\x62\x75\156\144\154\x65\162\56\152\163", "\156\x6f\x64\x65\137\x6d\x6f\144\x75\154\145\x73\57\166\165\145\57\144\151\163\164\57\166\x75\x65\x2e\162\x75\x6e\164\151\x6d\x65\x2e\145\x73\155\55\142\x72\157\x77\x73\145\162\x2e\x6a\x73", "\156\157\x64\x65\x5f\155\157\144\x75\154\x65\163\x2f\166\165\145\x2f\x64\x69\163\x74\57\166\165\x65\x2e\x72\x75\x6e\164\151\x6d\x65\56\x65\x73\155\55\142\162\x6f\167\163\x65\162\56\160\162\157\x64\56\x6a\163", "\156\157\x64\145\x5f\x6d\x6f\144\x75\154\x65\163\57\x76\x75\x65\x2f\x64\151\163\164\57\x76\x75\145\x2e\x72\165\x6e\164\151\155\145\56\145\x73\155\x2d\142\165\x6e\x64\x6c\x65\x72\x2e\152\x73", "\156\x6f\x64\145\x5f\155\157\144\x75\154\x65\163\x2f\166\x75\x65\x2f\x64\x69\x73\x74\x2f\x76\165\x65\x2e\162\165\x6e\164\151\x6d\x65\56\147\x6c\157\142\141\154\x2e\152\x73", "\156\x6f\x64\145\137\x6d\x6f\144\165\x6c\145\x73\57\x76\x75\x65\x2f\x64\x69\163\164\57\x76\x75\145\x2e\162\165\156\164\x69\155\145\x2e\x67\x6c\x6f\x62\141\x6c\x2e\x70\162\x6f\144\x2e\x6a\163", "\154\x69\142\163\57\x6a\161\160\x6c\x6f\x74\x2f\152\x71\x70\x6c\x6f\164\56\143\157\x72\145\56\x6a\x73", "\154\x69\142\163\x2f\x6a\x71\x70\x6c\157\x74\57\152\x71\160\154\x6f\164\56\x6c\x69\x6e\145\x52\145\156\x64\145\x72\x65\162\56\152\163", "\x6c\x69\x62\163\x2f\x6a\x71\160\154\x6f\x74\x2f\152\161\x70\x6c\x6f\164\x2e\x6c\x69\156\145\141\x72\x41\170\151\163\122\145\156\144\x65\x72\145\162\56\x6a\163", "\x6c\151\142\163\x2f\152\161\x70\x6c\157\164\57\152\x71\160\154\157\x74\56\164\150\145\x6d\145\105\156\147\151\x6e\x65\56\152\163", "\x6c\x69\142\163\57\152\161\x70\154\157\164\57\160\x6c\165\x67\x69\156\163\57\152\161\160\154\157\164\x2e\x62\141\162\122\x65\156\x64\145\162\145\x72\x2e\152\163", "\x6c\x69\x62\163\57\x6a\x71\x70\x6c\x6f\x74\x2f\x70\x6c\x75\147\151\156\163\57\x6a\161\160\154\x6f\164\56\160\151\x65\122\x65\x6e\x64\145\162\x65\x72\56\152\x73", "\x63\157\x6e\x66\151\147\57\x63\x6f\156\x66\151\x67\56\160\150\x70", "\52\x2e\x67\x69\164\151\147\156\157\162\145", "\x2a\x2e\x67\x69\164\x6d\x6f\144\x75\x6c\x65\x73", "\52\56\x67\x69\x74\x61\x74\x74\x72\151\142\x75\x74\145\163", "\x2a\56\x67\x69\164\x2d\x62\x6c\141\155\145\55\x69\147\156\157\162\145\x2d\162\x65\x76\x73", "\x2a\x2e\x62\157\167\145\x72\x72\143", "\x2a\x2e\142\x6f\167\145\162\x2e\152\163\157\156", "\x2a\142\157\x77\x65\162\56\x6a\x73\157\x6e", "\x2a\56\143\157\x76\145\162\141\x6c\x6c\163\56\x79\155\154", "\52\x2e\145\x64\151\164\x6f\x72\x63\x6f\156\x66\x69\147", "\52\56\x67\151\164\x6b\145\145\x70", "\52\56\x6a\x73\150\x69\156\x74\162\x63", "\x2a\x2e\x70\150\160\x5f\143\x73", "\x2a\x2e\160\x68\x70\x5f\143\x73\56\144\x69\x73\x74", "\x2a\160\x68\x70\165\x6e\151\x74\56\170\155\154\x2e\144\x69\x73\x74", "\52\160\150\160\165\156\x69\x74\56\170\x6d\154", "\x2a\x2e\160\150\x70\x63\163\56\x78\155\154\x2e\144\151\163\164", "\x2a\x70\150\x70\143\x73\56\170\155\154", "\52\x47\162\x75\x6e\x74\x66\x69\154\145\56\x6a\163", "\52\147\x72\165\156\x74\x66\151\154\145\x2e\152\x73", "\52\x2e\x6d\x61\x70", "\x2a\x2e\x74\x72\141\x76\151\x73\56\x79\x6d\154", "\x2a\x69\x6e\163\x74\141\154\154\145\x64\56\x6a\x73\x6f\x6e", "\x2a\160\x61\143\x6b\x61\x67\x65\56\x6a\163\157\x6e", "\52\x70\x61\x63\x6b\x61\x67\x65\55\154\x6f\143\153\x2e\152\163\157\156", "\x2a\171\141\162\x6e\56\154\x6f\x63\153", "\52\56\163\x63\162\x75\164\151\156\151\x7a\145\162\x2e\171\x6d\154", "\x2a\x2e\x67\151\164\163\164\x61\x74\163\x2e\171\x6d\154", "\x2a\x63\157\155\x70\x6f\163\x65\x72\x2e\152\163\x6f\156", "\x2a\x63\x6f\155\x70\157\x73\x65\162\x2e\x6c\x6f\143\x6b", "\52\x2e\x73\x70\x65\x63\x2e\152\x73", "\x2a\x2e\x70\x68\160\163\x74\x6f\x72\x6d\56\155\145\x74\x61\x2e\x70\150\x70", "\52\56\154\146\x73\x63\157\156\x66\151\147", "\x2a\x2e\x74\x72\x61\166\151\x73\x2e\x73\x68", "\52\164\x73\143\157\156\x66\151\147\x2e\152\x73\157\156", "\52\x74\163\143\x6f\x6e\146\151\147\56\x73\x70\x65\143\56\152\163\157\156", "\x2a\x2e\x65\x73\154\151\x6e\x74\162\x63\56\152\163", "\52\x2e\145\163\x6c\151\x6e\164\x69\147\x6e\x6f\x72\145", "\52\56\x65\163\x6c\151\156\164\x72\143", "\52\56\x62\x72\157\x77\x73\145\x72\163\154\151\163\x74\x72\x63", "\52\142\x61\x62\x65\x6c\x2e\143\157\x6e\x66\x69\x67\56\152\x73", "\x2a\152\145\163\x74\56\x63\157\156\146\151\x67\x2e\152\x73", "\x2a\x6b\x61\x72\155\x61\x2e\143\157\156\146\56\x6a\x73", "\52\x6b\141\162\155\x61\55\143\x6f\x6e\x66\x2e\x6a\163", "\x2a\x76\165\145\56\x63\x6f\x6e\146\151\147\56\x6a\x73", "\x2a\x2e\156\160\155\151\x67\156\x6f\162\x65", "\x2a\56\156\143\x75\162\x63\x2e\x6a\x73\x6f\x6e", "\x2a\x2e\160\162\145\x74\164\151\145\x72\x72\x63", "\x2a\x2e\x6a\163\143\163\162\143", "\x2a\x70\150\x70\163\164\x61\156\x2e\156\145\157\156", "\52\160\150\160\163\164\141\156\56\x6e\x65\x6f\156\x2e\x64\151\x73\x74", "\x2a\x70\x61\143\x6b\141\x67\145\x2e\x78\x6d\x6c", "\52\x2e\163\164\x79\x6c\x65\154\151\x6e\x74\x72\143\56\152\x73\x6f\x6e"); return $this->isFilePathFoundInArray($file, $filesAndFoldersToDeleteFromPackage); } private function getAllFilesizes() { $files = Filesystem::globr(PIWIK_INCLUDE_PATH, "\x2a"); $filesizes = array(); foreach ($files as $file) { if (!$this->isFileIncludedInFinalRelease($file)) { continue; } $filesize = filesize($file); if ($filesize === false) { throw new Exception("\x45\x72\162\157\x72\x20\x67\x65\x74\164\151\x6e\147\40\x66\151\154\x65\x73\151\x7a\145\x20\x66\x6f\x72\40\146\151\x6c\145\72\x20{$file}"); } $filesizes[$file] = $filesize; } return $filesizes; } protected function checkFilesDoNotHaveWeirdSpaces($files) { $weirdSpace = "\xc2\xa0"; $this->assertEquals("\x63\x32\x61\x30", bin2hex($weirdSpace), "\103\150\145\x63\x6b\151\x6e\147\40\x74\x68\141\x74\40\x74\150\x69\x73\40\x74\x65\163\164\x20\x66\x69\154\145\40\167\x61\x73\40\x6e\157\x74\40\164\141\x6d\x70\x65\162\x65\144\x20\167\x69\164\x68"); $this->assertEquals("\62\x30", bin2hex("\40"), "\103\x68\x65\x63\153\x69\156\x67\40\x74\150\141\x74\x20\164\150\151\x73\40\x74\x65\163\x74\x20\146\151\x6c\145\x20\167\141\163\x20\x6e\157\x74\40\164\x61\x6d\160\145\162\145\x64\x20\x77\151\x74\150"); $errors = array(); $countFileChecked = 0; foreach ($files as $file) { if ($this->isFileBelongToTests($file) || is_dir($file)) { continue; } if (strpos($file, "\x76\x65\x6e\144\x6f\x72\x2f\160\x68\x70\x2d\x64\151\57\x70\150\160\x2d\144\151\57\x77\145\x62\163\151\x74\x65\x2f") !== false || strpos($file, "\166\x65\156\x64\x6f\162\x2f\x70\x68\x70\x6d\x61\151\154\x65\162\57\160\x68\x70\155\x61\x69\154\x65\x72\x2f\x6c\141\156\x67\165\x61\x67\x65\57") !== false || strpos($file, "\x76\x65\x6e\x64\x6f\162\57\167\151\153\x69\x6d\x65\144\151\141\x2f\x6c\x65\x73\x73\x2e\160\x68\x70\57") !== false || strpos($file, "\x6e\157\x64\145\x5f\x6d\157\144\165\154\x65\x73\57") !== false || strpos($file, "\x76\x65\x6e\x64\157\x72\57\x6d\x61\171\146\x6c\x6f\x77\x65\162\57\x6d\157\x34\x2d\x63\157\144\151\156\147\x2d\163\164\141\156\x64\x61\162\144\57") !== false || strpos($file, "\x76\x65\x6e\x64\x6f\x72\x2f\163\x79\155\x66\x6f\156\x79\x2f\x70\157\x6c\171\x66\x69\x6c\x6c\55\x69\143\x6f\x6e\166\57") !== false || strpos($file, "\x76\145\156\x64\x6f\162\57\163\171\155\x66\x6f\x6e\171\57\160\x6f\x6c\171\x66\x69\x6c\x6c\x2d\151\156\164\x6c\55\x6e\157\x72\x6d\x61\154\x69\172\145\162\57") !== false || strpos($file, "\x70\154\165\147\151\156\163\x2f\x43\x6f\x72\145\x56\165\x65\57\160\x6f\x6c\x79\x66\151\x6c\x6c\x73\x2f\144\x69\163\164\x2f\x4d\141\164\x6f\155\157\x50\x6f\154\171\146\x69\x6c\x6c\163\56\x6d\151\x6e\56\x6a\x73") !== false || strpos($file, "\x70\x6c\x75\147\151\156\x73\57\126\x69\x73\151\164\157\162\107\145\x6e\145\162\141\x74\157\x72\57\x76\145\156\x64\157\162\x2f\146\x7a\x61\x6e\x69\156\x6f\164\x74\x6f\x2f\146\141\x6b\x65\x72\57\163\x72\x63\x2f\106\x61\x6b\145\162\57\120\162\x6f\x76\x69\x64\145\x72\x2f") !== false || preg_match("\45\x2f\x70\154\165\147\151\x6e\x73\57\x5b\x61\x2d\172\x41\x2d\x5a\x30\x2d\71\137\135\x2b\x2f\166\x75\x65\x2f\144\151\x73\x74\x25", $file)) { continue; } $content = file_get_contents($file); $posWeirdSpace = strpos($content, $weirdSpace); if ($posWeirdSpace !== false) { $around = substr($content, $posWeirdSpace - 20, 40); $around = trim($around); $errors[] = "\106\x69\x6c\x65\x20{$file}\40\x63\157\156\x74\141\151\x6e\x73\x20\x61\156\40\165\x6e\165\163\x75\x61\154\40\163\x70\x61\x63\145\x20\x63\150\x61\162\141\143\164\145\162\54\40\160\154\x65\141\x73\x65\40\x72\145\155\157\166\x65\x20\x69\164\x20\x66\162\157\155\40\150\145\x72\x65\x3a\x20\x2e\x2e\x2e{$around}\x2e\x2e\x2e"; } $countFileChecked++; } $this->assertGreaterThan(1, $countFileChecked, "\x65\x78\x70\145\143\x74\145\144\x20\164\157\x20\164\x65\x73\x74\40\141\164\x20\154\145\x61\163\x74\40\x6f\156\145\x20\146\x69\x6c\145\x2c\x20\x62\x75\164\x20\164\145\x73\164\x65\144\40\x6f\156\154\x79\40" . $countFileChecked); if (!empty($errors)) { throw new Exception(implode("\x2c\12\xa\40", $errors)); } } private function isFileBelongToTests($file) { return stripos($file, "\x2f\164\145\x73\x74\x73\x2f") !== false || stripos($file, "\57\x70\x68\141\x6e\164\157\155\152\x73\57") !== false; } private function getComposerJsonAsArray() { $composer = file_get_contents(PIWIK_INCLUDE_PATH . "\x2f\x63\157\155\x70\x6f\x73\x65\x72\x2e\x6a\163\x6f\x6e"); $composerJson = json_decode($composer, $assoc = true); return $composerJson; } private function getComposerLockAsArray() { $composer = file_get_contents(PIWIK_INCLUDE_PATH . "\x2f\143\157\x6d\x70\x6f\163\x65\162\x2e\x6c\157\x63\x6b"); $composerJson = json_decode($composer, $assoc = true); return $composerJson; } private function isFileIsAnIconButDoesNotBelongToDistribution($file) { return preg_match("\x7e\x4d\x6f\162\x70\150\145\x75\163\x2f\x69\143\157\156\163\x2f\x28\x3f\41\144\151\x73\164\51\x7e", $file); } }

Function Calls

None

Variables

None

Stats

MD5 364f2113c5df08ebf7a2947cc08b2ebc
Eval Count 0
Decode Time 120 ms