You are here

function _auditfiles_make_preg in Audit Files 7.4

Same name and namespace in other branches
  1. 5 auditfiles.module \_auditfiles_make_preg()
  2. 6.3 notindb.admin.inc \_auditfiles_make_preg()
  3. 6.2 notindb.admin.inc \_auditfiles_make_preg()
  4. 7.3 auditfiles.notindatabase.inc \_auditfiles_make_preg()

Escapes any possible regular expression characters in the specified string.

Parameters

string $element: The string to escape.

mixed $key: The key or index for the array item passed into $element.

bool $makefilepath: Set to TRUE to change elements to file paths at the same time.

1 string reference to '_auditfiles_make_preg'
_auditfiles_get_exclusions in ./auditfiles.notindatabase.inc
Creates an exclusion string.

File

./auditfiles.notindatabase.inc, line 839
Generates a report showing files on the server, but not in the database.

Code

function _auditfiles_make_preg(&$element, $key, $makefilepath = FALSE) {
  if ($makefilepath) {
    $realpath = drupal_realpath(file_build_uri($element));
    if ($realpath) {
      $element = $realpath;
    }
  }
  $element = preg_quote($element);
}