Skip to content

Commit ffd0876

Browse files
Removed protocol relative URL for jQuery
Nowadays the tendency of the web is to move to HTTPS, so the use of protocol-relative URLs has become an anti-pattern therefor I make this commit to update the codebase to reflect this. Furthermore, I have added charset="utf-8" and type="text/javascript" to tag_css and tag_js as to follow best practice.
1 parent 238711f commit ffd0876

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/MaterializeCSSBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MaterializeCSSBuilder {
1313

1414
public static function include_full() {
1515
$return = self::include_css();
16-
$return .= self::tag_js('//code.jquery.com/'.self::$file_jquery);
16+
$return .= self::tag_js('https://code.jquery.com/'.self::$file_jquery);
1717
$return .= self::include_js();
1818
return $return;
1919
}
@@ -61,13 +61,13 @@ public static function get_url_js($full=false, $secure=false) {
6161
}
6262

6363
private static function tag_css($path) {
64-
return '<link rel="stylesheet" href="'.$path.'">';
64+
return '<link rel="stylesheet" charset="utf-8" href="'.$path.'">';
6565
}
6666

6767
private static function tag_js($path) {
68-
return '<script src="'.$path.'"></script>';
68+
return '<script type="text/javascript" src="'.$path.'"></script>';
6969
}
7070

7171
}
7272

73-
?>
73+
?>

0 commit comments

Comments
 (0)