Changeset - 1cf1f641a5e5
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 14 years ago 2012-03-28 11:10:15
ohnobinki@ohnopublishing.net
Make school_crawl_url() actually function properly for relative URIs.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
inc/school.crawl.inc
Show inline comments
 
@@ -586,11 +586,14 @@ function school_crawl_url($orig_url, $ur
 
   * qualified URL. It falls back to the original URL if it fails to
 
   * match.
 
   */
 
  foreach (array($url, $orig_url) as $aurl)
 
  foreach (array($orig_url, $url) as $aurl)
 
    if (preg_match(';^(https?)://([^/]+)(/.*)$;', $aurl, $matches))
 
      {
 
	if (!empty($matches[1]))
 
	$new_url['schema'] = $matches[1];
 
	if (!empty($matches[2]))
 
	$new_url['hostname'] = $matches[2];
 
	if (!empty($matches[3]))
 
	$new_url['path'] = $matches[3];
 
      }
 

	
0 comments (0 inline, 0 general)