You are here

function _filefield_paths_replace_pattern in File (Field) Paths 6.2

Same name and namespace in other branches
  1. 6 filefield_paths.module \_filefield_paths_replace_pattern()

Run regular expression over all available text-based fields.

@TODO - This section needs work.

2 calls to _filefield_paths_replace_pattern()
pathfilter_filefield_paths_process_file in modules/pathfilter.inc
Implements hook_filefield_paths_process_file().
_filefield_paths_include_fix_references_filefield_paths_file_postprocess in includes/fix_references.inc
@file

File

includes/fix_references.inc, line 29

Code

function _filefield_paths_replace_pattern($pattern, &$node) {
  $update = FALSE;
  $fields = _filefield_paths_fix_references_fields($node);

  //dpm($fields);

  // Loop through all fields and process filter.
  foreach ($fields as &$field) {

    //$old = urldecode($field);

    //dpm($field);

    //dpm($pattern);

    //$field = drupal_urlencode(preg_replace("/{$pattern['find']}/s", $pattern['replace'], urldecode($field)));

    //if ($old != $field) {

    //  $update = TRUE;

    //}
  }
  return $update;
}