Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@googlemail.com>
Nikita Govorov <nikita.govorov@gmail.com>
-Mike Pennisi <mike@mikepennisi.com>
\ No newline at end of file
+Mike Pennisi <mike@mikepennisi.com>
+Markus Staab <markus.staab@redaxo.de>
\ No newline at end of file
if( count($_POST) ) {
$includes = array();
foreach( $_POST as $name => $ver ){
+ if ( empty( $libraries[ $name ] )) {
+ echo "unsupported library ". $name;
+ exit;
+ }
+
$url = $libraries[ $name ][ "url" ];
if( $name == "YUI" && $ver[0] == "2" ) {
- $url = str_replace( "/yui", "/yuiloader", $url, $count = 2 );
+ $url = str_replace( "/yui", "/yuiloader", $url);
+ }
+
+ if ( empty( $libraries[ $name ][ "versions" ][ $ver ] )) {
+ echo "library ". $name ." not supported in version ". $ver;
+ exit;
}
- $include = "<script src='$baseURL".str_replace("XYZ", $ver, $url, $count = 1)."'></script>\n";
+
+ $include = "<script src='$baseURL".str_replace("XYZ", $ver, $url)."'></script>\n";
if( $lib == "prototype" ) { // prototype must be included first
array_unshift( $includes, $include );
} else {