I want add export link in some place if current path plus '/export' exists. But can't understand how check such urls. The problem is when path exists with less number of arguments drupal_valid_path()
returns TRUE. For example I have path 'reports' but don't have path 'reports/export'.
I check paths like this:
$export_path = current_path() . '/export';
if (drupal_valid_path($export_path)) {
$export_options = drupal_get_query_parameters();
$link_options = array(
'attributes' => array(
'class' => array('open'),
'target' => '_blank',
),
'query' => $export_options,
);
$vars['print_links'] = l('', $export_path, $link_options);
}
How do I need check paths?