diff options
author | Evan Prodromou <evan@dev.controlezvous.ca> | 2008-07-15 20:44:14 -0400 |
---|---|---|
committer | Evan Prodromou <evan@dev.controlezvous.ca> | 2008-07-15 20:44:14 -0400 |
commit | b9df3424379b086cf5d512e1b00b0f7f36d59a84 (patch) | |
tree | 8003e551a00b7731fc49bb3cee694ede7a856d77 /sitemap.php | |
parent | 1509f3893c1ebe17959207e911653235608b10c2 (diff) |
only loop through the list if there's a list
darcs-hash:20080716004414-d018c-dad819f8c5881271f494dd27a073baa05bb7e7bc.gz
Diffstat (limited to 'sitemap.php')
-rw-r--r-- | sitemap.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sitemap.php b/sitemap.php index 538646a7e..41d227711 100644 --- a/sitemap.php +++ b/sitemap.php @@ -291,11 +291,13 @@ function urlset($urlset_text) { function array_to_map($url_list, $filename_prefix) { global $output_paths; - # $map_urls is a long string containing concatenated <url></url> elements. - while (list($map_idx, $map_urls) = each($url_list)) { - $urlset_path = $output_paths['output_dir'] . "$filename_prefix-$map_idx.xml"; - - write_file($urlset_path, urlset($map_urls)); + if ($url_list) { + # $map_urls is a long string containing concatenated <url></url> elements. + while (list($map_idx, $map_urls) = each($url_list)) { + $urlset_path = $output_paths['output_dir'] . "$filename_prefix-$map_idx.xml"; + + write_file($urlset_path, urlset($map_urls)); + } } } |