Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 200
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
/*
3
/*
4
 * This file is part of Psy Shell.
4
 * This file is part of Psy Shell.
5
 *
5
 *
6
 * (c) 2012-2022 Justin Hileman
6
 * (c) 2012-2023 Justin Hileman
7
 *
7
 *
8
 * For the full copyright and license information, please view the LICENSE
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
9
 * file that was distributed with this source code.
Zeile 54... Zeile 54...
54
     *
54
     *
55
     * The other formats are supported by PHP's stripcslashes,
55
     * The other formats are supported by PHP's stripcslashes,
56
     * except for the \s sequence (ASCII space).
56
     * except for the \s sequence (ASCII space).
57
     *
57
     *
58
     * @param string $input The string to decode
58
     * @param string $input The string to decode
59
     *
-
 
60
     * @return string
-
 
61
     */
59
     */
62
    public static function unvis(string $input): string
60
    public static function unvis(string $input): string
63
    {
61
    {
64
        $output = \preg_replace_callback(self::UNVIS_RX, 'self::unvisReplace', $input);
62
        $output = \preg_replace_callback(self::UNVIS_RX, [self::class, 'unvisReplace'], $input);
65
        // other escapes & octal are handled by stripcslashes
63
        // other escapes & octal are handled by stripcslashes
66
        return \stripcslashes($output);
64
        return \stripcslashes($output);
67
    }
65
    }
Zeile 68... Zeile 66...
68
 
66
 
69
    /**
67
    /**
70
     * Callback for Str::unvis.
68
     * Callback for Str::unvis.
71
     *
69
     *
72
     * @param array $match The matches passed by preg_replace_callback
-
 
73
     *
-
 
74
     * @return string
70
     * @param array $match The matches passed by preg_replace_callback
75
     */
71
     */
76
    protected static function unvisReplace(array $match): string
72
    protected static function unvisReplace(array $match): string
77
    {
73
    {
78
        // \040, \s
74
        // \040, \s