You are here

function imagepicker_strip_messages in Image Picker 5.2

Same name and namespace in other branches
  1. 5 imagepicker.module \imagepicker_strip_messages()
  2. 6.2 imagepicker.functions.inc \imagepicker_strip_messages()
  3. 7 imagepicker.functions.inc \imagepicker_strip_messages()

There is no need to inform users that directory structure has been created and show them all paths... So lets strip these messages if there are any.

1 call to imagepicker_strip_messages()
theme_imagepicker in ./imagepicker.module
theming

File

./imagepicker.module, line 953
Enables permitted roles to upload images for insertion into configured nodes.

Code

function imagepicker_strip_messages($msg) {
  if ($msg) {
    $dirsep = DIRECTORY_SEPARATOR == '\\' ? '\\\\' : '\\/';
    $pattern = '/<li>.*' . $dirsep . IMAGEPICKER_FILES_DIR . $dirsep . '.*<\\/li>/i';
    $msg = preg_replace($pattern, '', $msg);
  }
  return $msg;
}