CasperSecurity

Current Path : /var/www/DbSyncProject_Limsysuim_DB/vendor/league/commonmark/src/Normalizer/
Upload File :
Current File : /var/www/DbSyncProject_Limsysuim_DB/vendor/league/commonmark/src/Normalizer/SlugNormalizer.php

<?php

declare(strict_types=1);

/*
 * This file is part of the league/commonmark package.
 *
 * (c) Colin O'Dell <colinodell@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\CommonMark\Normalizer;

/**
 * Creates URL-friendly strings based on the given string input
 */
final class SlugNormalizer implements TextNormalizerInterface
{
    /**
     * {@inheritdoc}
     */
    public function normalize(string $text, $context = null): string
    {
        // Trim whitespace
        $slug = \trim($text);
        // Convert to lowercase
        $slug = \mb_strtolower($slug);
        // Try replacing whitespace with a dash
        $slug = \preg_replace('/\s+/u', '-', $slug) ?? $slug;
        // Try removing characters other than letters, numbers, and marks.
        $slug = \preg_replace('/[^\p{L}\p{Nd}\p{Nl}\p{M}-]+/u', '', $slug) ?? $slug;

        return $slug;
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY