You are here

public function ShellManagerInterface::escapeShellArg in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/ShellManagerInterface.php \Drupal\fillpdf\ShellManagerInterface::escapeShellArg()

Escapes a string.

PHP escapeshellarg() drops non-ascii characters, this is a replacement.

Stop-gap replacement until core issue #1561214 has been solved. Solution proposed in #1502924-8.

PHP escapeshellarg() on Windows also drops % (percentage sign) characters. We prevent this by replacing it with a pattern that should be highly unlikely to appear in the string itself and does not contain any "dangerous" character at all (very wide definition of dangerous). After escaping we replace that pattern back with a % character.

Parameters

string $arg: The string to escape.

Return value

string Escaped string.

See also

https://www.drupal.org/project/drupal/issues/1561214

1 method overrides ShellManagerInterface::escapeShellArg()
ShellManager::escapeShellArg in src/ShellManager.php
Escapes a string.

File

src/ShellManagerInterface.php, line 56

Class

ShellManagerInterface
Provides an interface for FillPDF execution manager.

Namespace

Drupal\fillpdf

Code

public function escapeShellArg($arg);