Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Common.php

function Common::escapeshellcmd

Escape a path to a system command.

Parameters

string $cmd The path to the system command.:

Return value

string

9 calls to Common::escapeshellcmd()
ClosureLinterSniff::process in vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php
Processes the tokens that this sniff is interested in.
CodeAnalyzerSniff::process in vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php
Processes the tokens that this sniff is interested in.
CSSLintSniff::process in vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php
Processes the tokens that this sniff is interested in.
ESLintSniff::process in vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php
Processes the tokens that this sniff is interested in.
JavaScriptLintSniff::process in vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php
Processes the tokens that this sniff is interested in.

... See full list

File

vendor/squizlabs/php_codesniffer/src/Util/Common.php, line 252

Class

Common

Namespace

PHP_CodeSniffer\Util

Code

public static function escapeshellcmd($cmd) {
    $cmd = escapeshellcmd($cmd);
    if (stripos(PHP_OS, 'WIN') === 0) {
        // Spaces are not escaped by escapeshellcmd on Windows, but need to be
        // for the command to be able to execute.
        $cmd = preg_replace('`(?<!^) `', '^ ', $cmd);
    }
    return $cmd;
}
RSS feed
Powered by Drupal