Closed (works as designed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2013 at 05:33 UTC
Updated:
14 Mar 2013 at 20:10 UTC
API page: http://api.drupal.org/api/drupal/includes%21path.inc/function/drupal_val...
Enter a descriptive title (above) relating to function drupal_valid_path, then describe the problem you have found:
This function returns a false TRUE for fully spec'd urls that don't exist. Try this on the 'Execute PHP' page, substituting localhost or whatever, and see what happens.
$test = drupal_valid_path( 'http://d7b.dev/when/pigs/fly');
echo $test ? 'True' : 'False';
Comments
Comment #1
jhodgdonSee: http://drupal.org/glossary#path -- you are passing in a full URL and not a path.
If you pass in a full URL, then it will pass the is_external() test in this function and return TRUE always. So... I think this is a "works as designed" issue. If you pass in only the path ('when/pigs/fly') it should work as you expect.