You are here

function _views_break_phrase in Views (for Drupal 7) 5

2 calls to _views_break_phrase()
views_handler_arg_nid in modules/views_node.inc
views_handler_arg_taxid in modules/views_taxonomy.inc

File

./views.module, line 1818

Code

function _views_break_phrase($str) {
  if (preg_match('/^([0-9]+[+ ])+[0-9]+$/', $str)) {

    // The '+' character in a query string may be parsed as ' '.
    return array(
      'or',
      preg_split('/[+ ]/', $str),
    );
  }
  else {
    if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
      return array(
        'and',
        explode(',', $str),
      );
    }
    else {
      return NULL;
    }
  }
}