Merge branch 'xorg/maint' into xorg/master
[platal.git] / modules / gadgets / gadgets.inc.php
index f668fb4..3a9a8f1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,8 +23,7 @@
 function init_igoogle_xml($template)
 {
     Platal::page()->changeTpl($template, NO_SKIN);
-
-    header('Content-Type: application/xml; charset=utf-8');
+    pl_cached_content_headers("application/xml", "utf-8");
 }
 
 function init_igoogle_html($template, $auth = AUTH_PUBLIC)
@@ -37,7 +36,7 @@ function init_igoogle_html($template, $auth = AUTH_PUBLIC)
 
     // Adds external JavaScript libraries provided by iGoogle to the page.
     if (Env::has('libs')) {
-        $libs = split(',', Env::s('libs'));
+        $libs = preg_split('/,/', Env::s('libs'), -1, PREG_SPLIT_NO_EMPTY);
         foreach ($libs as $lib) {
             if (preg_match('@^[a-z0-9/._-]+$@i', $lib) && !preg_match('@([.][.])|([.]/)|(//)@', $lib)) {
                 $page->append('gadget_js', 'https://www.google.com/ig/f/' . $lib);