You are here

function _auditfiles_make_preg in Audit Files 7.3

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.4 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.

array $user_data: Data to operate on the specified file name with. Currently, this array consists of two elements:

  • real_files_path: A string with the path to the file, as specified in the "File system path" setting on the administrative configuration page.
  • make_file_path: A boolean value, indeicating whether to change elements to file paths.
1 string reference to '_auditfiles_make_preg'
_auditfiles_get_exclusions in ./auditfiles.notindatabase.inc
Creates an exclusion string.

File

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

Code

function _auditfiles_make_preg(&$element, $key, array $user_data) {
  if ($user_data['make_file_path']) {
    $realpath = $user_data['real_files_path'] . '/' . $element;
    if ($realpath) {
      $element = $realpath;
    }
  }
  $element = preg_quote($element);
}