File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -646,28 +646,31 @@ public function layer($layer_id = 0)
646
646
$ layer_url = $ layer ->layer_url ;
647
647
$ layer_file = $ layer ->layer_file ;
648
648
649
+ $ content === FALSE ;
650
+
649
651
if ($ layer_url != '' )
650
652
{
651
653
// Pull from a URL
652
654
$ layer_link = $ layer_url ;
655
+ $ layer_request = new HttpClient ($ layer_link );
656
+ $ content = $ layer_request ->execute ();
657
+ if ($ content === FALSE )
658
+ {
659
+ throw new Kohana_Exception ($ layer_request ->get_error_msg ());
660
+ }
653
661
}
654
662
else
655
663
{
656
664
// Pull from an uploaded file
657
665
$ layer_link = Kohana::config ('upload.directory ' ).'/ ' .$ layer_file ;
666
+ $ content = readfile ($ layer_link );
667
+ if ($ content === FALSE )
668
+ {
669
+ throw new Kohana_Exception ("Couldn't read KML file: " . $ layer_link );
670
+ }
658
671
}
659
672
660
- $ layer_request = new HttpClient ($ layer_link );
661
- $ content = $ layer_request ->execute ();
662
-
663
- if ($ content === FALSE )
664
- {
665
- throw new Kohana_Exception ($ layer_request ->get_error_msg ());
666
- }
667
- else
668
- {
669
- echo $ content ;
670
- }
673
+ echo $ content ;
671
674
}
672
675
else
673
676
{
You can’t perform that action at this time.
0 commit comments