Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/mageworx/module-seoxtemplates/Helper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-seoxtemplates/Helper/Converter.php
<?php
/**
 * Copyright © 2016 MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */

/**
 * SEO templates converter helper
 *
 */
namespace MageWorx\SeoXTemplates\Helper;

class Converter extends \Magento\Framework\App\Helper\AbstractHelper
{
    const STATIC_VALUE_DELIMITER = '||';

    /**
     * @param $rawValue
     * @return string
     */
    public function randomize($rawValue)
    {
        if (strpos($rawValue, self::STATIC_VALUE_DELIMITER) === false) {
            return $rawValue;
        }

        $lValue = ltrim($rawValue);
        $leftSpaceCount = strlen($rawValue) - strlen($lValue);

        $rValue = rtrim($rawValue);
        $rightSpaceCount = strlen($rawValue) - strlen($rValue);

        $trimValue = trim($rawValue);

        $values = explode(self::STATIC_VALUE_DELIMITER, $trimValue);
        $value  = str_repeat(' ', $leftSpaceCount) . $values[array_rand($values)] . str_repeat(' ', $rightSpaceCount);

        return $value;
    }

    /**
     * @param string $rawValue
     * @return string
     */
    public function randomizePrefix($rawValue)
    {
        return $this->randomize($rawValue);
    }

    /**
     * @param string $rawValue
     * @return string
     */
    public function randomizeSuffix($rawValue)
    {
        return $this->randomize($rawValue);
    }

    /**
     * @param string $data
     * @return string
     */
    public function stripTags(string $data): string
    {
        $data = preg_replace("'<style[^>]*?>.*?</style>'si", "", $data);

        return strip_tags($data);
    }
}

Spamworldpro Mini