One Hat Cyber Team
Your IP:
216.73.216.102
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
fluxyjvi
/
www
/
assets
/
images
/
Edit File:
mews.tar
purifier/src/helpers.php 0000644 00000000231 15105620557 0011335 0 ustar 00 <?php if (!function_exists('clean')) { function clean($dirty, $config = null) { return app('purifier')->clean($dirty, $config); } } purifier/src/PurifierServiceProvider.php 0000644 00000003014 15105620557 0014516 0 ustar 00 <?php namespace Mews\Purifier; use Illuminate\Container\Container; use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider; use Laravel\Lumen\Application as LumenApplication; class PurifierServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Boot the service provider. * * @return null */ public function boot() { if ($this->app instanceof LaravelApplication) { $this->publishes([$this->getConfigSource() => config_path('purifier.php')]); } elseif ($this->app instanceof LumenApplication) { $this->app->configure('purifier'); } } /** * Get the config source. * * @return string */ protected function getConfigSource() { return realpath(__DIR__.'/../config/purifier.php'); } /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfigFrom($this->getConfigSource(), 'purifier'); $this->app->singleton('purifier', function (Container $app) { return new Purifier($app['files'], $app['config']); }); $this->app->alias('purifier', Purifier::class); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['purifier']; } } purifier/src/Facades/Purifier.php 0000644 00000000511 15105620557 0013007 0 ustar 00 <?php namespace Mews\Purifier\Facades; use Illuminate\Support\Facades\Facade; /** * @method static mixed clean($dirty, $config = null, \Closure $postCreateConfigHook = null) * @see \Mews\Purifier */ class Purifier extends Facade { protected static function getFacadeAccessor() { return 'purifier'; } } purifier/src/Casts/CleanHtmlInput.php 0000644 00000001574 15105620557 0013652 0 ustar 00 <?php namespace Mews\Purifier\Casts; use Illuminate\Contracts\Database\Eloquent\CastsAttributes; class CleanHtmlInput implements CastsAttributes { use WithConfig; /** * Cast the given value. Does not clean the HTML. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return array */ public function get($model, $key, $value, $attributes) { return $value; } /** * Prepare the given value for storage by cleaning the HTML. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param array $value * @param array $attributes * @return string */ public function set($model, $key, $value, $attributes) { return clean($value, $this->config); } } purifier/src/Casts/CleanHtmlOutput.php 0000644 00000001577 15105620557 0014056 0 ustar 00 <?php namespace Mews\Purifier\Casts; use Illuminate\Contracts\Database\Eloquent\CastsAttributes; class CleanHtmlOutput implements CastsAttributes { use WithConfig; /** * Clean the HTML when casting the given value. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return array */ public function get($model, $key, $value, $attributes) { return clean($value, $this->config); } /** * Prepare the given value for storage. Does not clean the HTML. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param array $value * @param array $attributes * @return string */ public function set($model, $key, $value, $attributes) { return $value; } } purifier/src/Casts/WithConfig.php 0000644 00000000323 15105620557 0013013 0 ustar 00 <?php namespace Mews\Purifier\Casts; trait WithConfig { /** * @var mixed */ protected $config; public function __construct($config = null) { $this->config = $config; } } purifier/src/Casts/CleanHtml.php 0000644 00000001613 15105620557 0012624 0 ustar 00 <?php namespace Mews\Purifier\Casts; use Illuminate\Contracts\Database\Eloquent\CastsAttributes; class CleanHtml implements CastsAttributes { use WithConfig; /** * Clean the HTML when casting the given value. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return array */ public function get($model, $key, $value, $attributes) { return clean($value, $this->config); } /** * Prepare the given value for storage by cleaning the HTML. * * @param \Illuminate\Database\Eloquent\Model $model * @param string $key * @param array $value * @param array $attributes * @return string */ public function set($model, $key, $value, $attributes) { return clean($value, $this->config); } } purifier/src/Purifier.php 0000644 00000021047 15105620557 0011470 0 ustar 00 <?php namespace Mews\Purifier; /** * Laravel 5 HTMLPurifier package * * @copyright Copyright (c) 2015 MeWebStudio * @version 2.0.0 * @author Muharrem ERİN * @contact me@mewebstudio.com * @web http://www.mewebstudio.com * @date 2014-04-02 * @license MIT */ use Exception; use HTMLPurifier; use HTMLPurifier_Config; use HTMLPurifier_HTMLDefinition; use Illuminate\Contracts\Config\Repository; use Illuminate\Filesystem\Filesystem; class Purifier { /** * @var Filesystem */ protected $files; /** * @var Repository */ protected $config; /** * @var HTMLPurifier */ protected $purifier; /** * Constructor * * @param Filesystem $files * @param Repository $config * @throws Exception */ public function __construct(Filesystem $files, Repository $config) { $this->files = $files; $this->config = $config; $this->setUp(); } /** * Setup * * @throws Exception */ private function setUp() { if (!$this->config->has('purifier')) { throw new Exception('Configuration parameters not loaded!'); } $this->checkCacheDirectory(); // Create a new configuration object $config = $this->getConfig(); // Create HTMLPurifier object $this->purifier = new HTMLPurifier($config); } /** * Add a custom definition * * @see http://htmlpurifier.org/docs/enduser-customize.html * @param array $definitionConfig * @param HTMLPurifier_Config $configObject Defaults to using default config * * @return HTMLPurifier_Config $configObject */ private function addCustomDefinition(array $definitionConfig, HTMLPurifier_Config $configObject = null) { if (!$configObject) { $configObject = HTMLPurifier_Config::createDefault(); $configObject->loadArray($this->getConfig()); } // Setup the custom definition $configObject->set('HTML.DefinitionID', $definitionConfig['id']); $configObject->set('HTML.DefinitionRev', $definitionConfig['rev']); // Enable debug mode if (!isset($definitionConfig['debug']) || $definitionConfig['debug']) { $configObject->set('Cache.DefinitionImpl', null); } // Start configuring the definition if ($def = $configObject->maybeGetRawHTMLDefinition()) { // Create the definition attributes if (!empty($definitionConfig['attributes'])) { $this->addCustomAttributes($definitionConfig['attributes'], $def); } // Create the definition elements if (!empty($definitionConfig['elements'])) { $this->addCustomElements($definitionConfig['elements'], $def); } } return $configObject; } /** * Add provided attributes to the provided definition * * @param array $attributes * @param HTMLPurifier_HTMLDefinition $definition * * @return HTMLPurifier_HTMLDefinition $definition */ private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinition $definition) { foreach ($attributes as $attribute) { // Get configuration of attribute $required = !empty($attribute[3]) ? true : false; $onElement = $attribute[0]; $attrName = $required ? $attribute[1] . '*' : $attribute[1]; $validValues = $attribute[2]; if ($onElement === '*') { $def = $validValues; if (is_string($validValues)) { $def = new $validValues(); } if ($def instanceof \HTMLPurifier_AttrDef) { $definition->info_global_attr[$attrName] = $def; } continue; } if (class_exists($validValues)) { $validValues = new $validValues(); } $definition->addAttribute($onElement, $attrName, $validValues); } return $definition; } /** * Add provided elements to the provided definition * * @param array $elements * @param HTMLPurifier_HTMLDefinition $definition * * @return HTMLPurifier_HTMLDefinition $definition */ private function addCustomElements(array $elements, HTMLPurifier_HTMLDefinition $definition) { foreach ($elements as $element) { // Get configuration of element $name = $element[0]; $contentSet = $element[1]; $allowedChildren = $element[2]; $attributeCollection = $element[3]; $attributes = isset($element[4]) ? $element[4] : null; if (!empty($attributes)) { $definition->addElement($name, $contentSet, $allowedChildren, $attributeCollection, $attributes); } else { $definition->addElement($name, $contentSet, $allowedChildren, $attributeCollection); } } } /** * Check/Create cache directory */ private function checkCacheDirectory() { $cachePath = $this->config->get('purifier.cachePath'); if ($cachePath) { if (!$this->files->isDirectory($cachePath)) { $this->files->makeDirectory($cachePath, $this->config->get('purifier.cacheFileMode', 0755),true); } } } /** * @param null $config * * @return mixed|null */ protected function getConfig($config = null) { // Create a new configuration object $configObject = HTMLPurifier_Config::createDefault(); // Allow configuration to be modified if (! $this->config->get('purifier.finalize')) { $configObject->autoFinalize = false; } // Set default config $defaultConfig = []; $defaultConfig['Core.Encoding'] = $this->config->get('purifier.encoding'); $defaultConfig['Cache.SerializerPath'] = $this->config->get('purifier.cachePath'); $defaultConfig['Cache.SerializerPermissions'] = $this->config->get('purifier.cacheFileMode', 0755); if (! $config) { $config = $this->config->get('purifier.settings.default'); } elseif (is_string($config)) { $config = $this->config->get('purifier.settings.' . $config); } if (! is_array($config)) { $config = []; } // Merge configurations $config = $defaultConfig + $config; // Load to Purifier config $configObject->loadArray($config); // Load custom definition if set if ($definitionConfig = $this->config->get('purifier.settings.custom_definition')) { $this->addCustomDefinition($definitionConfig, $configObject); } // Load custom elements if set if ($elements = $this->config->get('purifier.settings.custom_elements')) { if ($def = $configObject->maybeGetRawHTMLDefinition()) { $this->addCustomElements($elements, $def); } } // Load custom attributes if set if ($attributes = $this->config->get('purifier.settings.custom_attributes')) { if ($def = $configObject->maybeGetRawHTMLDefinition()) { $this->addCustomAttributes($attributes, $def); } } return $configObject; } /** * @param $dirty * @param null $config * @param \Closure|null $postCreateConfigHook * @return mixed */ public function clean($dirty, $config = null, \Closure $postCreateConfigHook = null) { if (is_array($dirty)) { return array_map(function ($item) use ($config) { return $this->clean($item, $config); }, $dirty); } $configObject = null; if ($config !== null) { $configObject = $this->getConfig($config); if ($postCreateConfigHook !== null) { $postCreateConfigHook->call($this, $configObject); } } //If $dirty is not an explicit string, bypass purification assuming configuration allows this $ignoreNonStrings = $this->config->get('purifier.ignoreNonStrings', false); $stringTest = is_string($dirty); if($stringTest === false && $ignoreNonStrings === true) { return $dirty; } return $this->purifier->purify($dirty, $configObject); } /** * Get HTMLPurifier instance. * * @return \HTMLPurifier */ public function getInstance() { return $this->purifier; } } purifier/LICENSE 0000644 00000002110 15105620557 0007376 0 ustar 00 The MIT License (MIT) Copyright (c) 2015 MeWebStudio - Muharrem ERİN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. purifier/composer.json 0000644 00000002752 15105620557 0011127 0 ustar 00 { "name": "mews/purifier", "type": "package", "description": "Laravel 5/6/7/8/9/10 HtmlPurifier Package", "keywords": ["Laravel HtmlPurifier", "Laravel Purifier", "Laravel Security", "HtmlPurifier", "Purifier", "security", "xss"], "homepage": "https://github.com/mewebstudio/purifier", "license": "MIT", "authors": [ { "name": "Muharrem ERİN", "email": "me@mewebstudio.com", "homepage": "https://github.com/mewebstudio", "role": "Developer" } ], "require": { "php": "^7.2|^8.0", "illuminate/config": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0", "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0", "illuminate/filesystem": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0", "ezyang/htmlpurifier": "^4.16.0" }, "require-dev": { "phpunit/phpunit": "^8.0|^9.0|^10.0", "mockery/mockery": "^1.3.3", "graham-campbell/testbench": "^3.2|^5.5.1" }, "suggest": { "laravel/framework": "To test the Laravel bindings", "laravel/lumen-framework": "To test the Lumen bindings" }, "autoload": { "psr-4": { "Mews\\Purifier\\": "src/" }, "files": [ "src/helpers.php" ] }, "autoload-dev": { "psr-4": { "Mews\\Tests\\Purifier\\": "tests/" } }, "extra": { "laravel": { "providers": [ "Mews\\Purifier\\PurifierServiceProvider" ], "aliases": { "Purifier": "Mews\\Purifier\\Facades\\Purifier" } } }, "minimum-stability": "dev", "prefer-stable": true } purifier/config/purifier.php 0000644 00000010545 15105620557 0012207 0 ustar 00 <?php /** * Ok, glad you are here * first we get a config instance, and set the settings * $config = HTMLPurifier_Config::createDefault(); * $config->set('Core.Encoding', $this->config->get('purifier.encoding')); * $config->set('Cache.SerializerPath', $this->config->get('purifier.cachePath')); * if ( ! $this->config->get('purifier.finalize')) { * $config->autoFinalize = false; * } * $config->loadArray($this->getConfig()); * * You must NOT delete the default settings * anything in settings should be compacted with params that needed to instance HTMLPurifier_Config. * * @link http://htmlpurifier.org/live/configdoc/plain.html */ return [ 'encoding' => 'UTF-8', 'finalize' => true, 'ignoreNonStrings' => false, 'cachePath' => storage_path('app/purifier'), 'cacheFileMode' => 0755, 'settings' => [ 'default' => [ 'HTML.Doctype' => 'HTML 4.01 Transitional', 'HTML.Allowed' => 'h1,h2,h3,h4,h5,h6,div,div[class],b,strong,i,em,u,a[href|title],ul,ol,li,p[style],br,span[style],span[class],img[width|height|alt|src|class]', 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align', 'AutoFormat.AutoParagraph' => true, 'AutoFormat.RemoveEmpty' => true, ], 'test' => [ 'Attr.EnableID' => 'true', ], "youtube" => [ "HTML.SafeIframe" => 'true', "URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%", ], 'custom_definition' => [ 'id' => 'html5-definitions', 'rev' => 1, 'debug' => false, 'elements' => [ // http://developers.whatwg.org/sections.html ['section', 'Block', 'Flow', 'Common'], ['nav', 'Block', 'Flow', 'Common'], ['article', 'Block', 'Flow', 'Common'], ['aside', 'Block', 'Flow', 'Common'], ['header', 'Block', 'Flow', 'Common'], ['footer', 'Block', 'Flow', 'Common'], // Content model actually excludes several tags, not modelled here ['address', 'Block', 'Flow', 'Common'], ['hgroup', 'Block', 'Required: h1 | h2 | h3 | h4 | h5 | h6', 'Common'], // http://developers.whatwg.org/grouping-content.html ['figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'], ['figcaption', 'Inline', 'Flow', 'Common'], // http://developers.whatwg.org/the-video-element.html#the-video-element ['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [ 'src' => 'URI', 'type' => 'Text', 'width' => 'Length', 'height' => 'Length', 'poster' => 'URI', 'preload' => 'Enum#auto,metadata,none', 'controls' => 'Bool', ]], ['source', 'Block', 'Flow', 'Common', [ 'src' => 'URI', 'type' => 'Text', ]], // http://developers.whatwg.org/text-level-semantics.html ['s', 'Inline', 'Inline', 'Common'], ['var', 'Inline', 'Inline', 'Common'], ['sub', 'Inline', 'Inline', 'Common'], ['sup', 'Inline', 'Inline', 'Common'], ['mark', 'Inline', 'Inline', 'Common'], ['wbr', 'Inline', 'Empty', 'Core'], // http://developers.whatwg.org/edits.html ['ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], ['del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], ], 'attributes' => [ ['iframe', 'allowfullscreen', 'Bool'], ['table', 'height', 'Text'], ['td', 'border', 'Text'], ['th', 'border', 'Text'], ['tr', 'width', 'Text'], ['tr', 'height', 'Text'], ['tr', 'border', 'Text'], ], ], 'custom_attributes' => [ ['a', 'target', 'Enum#_blank,_self,_target,_top'], ], 'custom_elements' => [ ['u', 'Inline', 'Inline', 'Common'], ], ], ]; purifier/phpunit.xml 0000644 00000001643 15105620557 0010614 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" verbose="true" > <testsuites> <testsuite name="Laravel Purifier Test Suite"> <directory suffix="Test.php">./tests</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">./src</directory> </whitelist> </filter> </phpunit>