Skip to content

Commit

Permalink
dependency update, gettext fix, firewall update
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuer committed Jun 4, 2023
1 parent e68fd80 commit 7447f1d
Show file tree
Hide file tree
Showing 10 changed files with 1,165 additions and 1,078 deletions.
2 changes: 1 addition & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PHP Microsite Boilerplate
* +++++++++++++++++++++++++
*
* Version: 2.0.12
* Version: 2.0.13
* Creator: Jens Kuerschner (https://jenskuerschner.de)
* Project: https://github.com/jekuer/php-microsite-boilerplate
* License: GNU General Public License v3.0 (gpl-3.0)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Current version of the website.
// Will be used to control css and js caching.
$version_nr = '2.0.12';
$version_nr = '2.0.13';

// Multilanguage
$language['default'] = 'en'; // Use a key from the array below.
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* PHP Microsite Boilerplate
* +++++++++++++++++++++++++
*
* Version: 2.0.12
* Version: 2.0.13
* Creator: Jens Kuerschner (https://jenskuerschner.de)
* Project: https://github.com/jekuer/php-microsite-boilerplate
* License: GNU General Public License v3.0 (gpl-3.0)
Expand Down
12 changes: 6 additions & 6 deletions lib/gettext/gettext.inc
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ function get_list_of_locales($locale) {
if ($modifier) {
if ($country) {
if ($charset)
array_push($locale_names, "${lang}_$country.$charset@$modifier");
array_push($locale_names, "${lang}_$country@$modifier");
array_push($locale_names, "{$lang}_$country.$charset@$modifier");
array_push($locale_names, "{$lang}_$country@$modifier");
} elseif ($charset)
array_push($locale_names, "${lang}.$charset@$modifier");
array_push($locale_names, "{$lang}.$charset@$modifier");
array_push($locale_names, "$lang@$modifier");
}
if ($country) {
if ($charset)
array_push($locale_names, "${lang}_$country.$charset");
array_push($locale_names, "${lang}_$country");
array_push($locale_names, "{$lang}_$country.$charset");
array_push($locale_names, "{$lang}_$country");
} elseif ($charset)
array_push($locale_names, "${lang}.$charset");
array_push($locale_names, "{$lang}.$charset");
array_push($locale_names, $lang);
}

Expand Down
206 changes: 114 additions & 92 deletions nginx_conf/7g-firewall.conf

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions nginx_conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#http {


# 7G FIREWALL - NGINX v1.4
# 7G FIREWALL - NGINX v1.6
include /etc/nginx/conf.d/7g-firewall.conf;


Expand Down Expand Up @@ -42,59 +42,71 @@
root /home/site/wwwroot;


# 7G FIREWALL - NGINX v1.4
# @ https://perishablepress.com/7g-firewall/
# 7G FIREWALL - NGINX v1.6
# @ https://perishablepress.com/7g-firewall-nginx/

set $7g_reason "";
set $7g_drop_bad_bot 0;
set $7g_drop_bad_referer 0;
set $7g_drop_bad_query_string 0;
set $7g_drop_bad_request 0;
set $7g_drop_bad_method 0;
set $7g_drop 0;

if ($bad_bot_7g) {
set $7g_reason "${7g_reason}:bad_bot_${bad_bot_7g}:";
set $7g_drop_bad_bot 1;
}
if ($bad_referer_7g) {

if ($bad_referer_7g) {
set $7g_reason "${7g_reason}:bad_referer_${bad_referer_7g}:";
set $7g_drop_bad_referer 1;
}

if ($bad_querystring_7g) {
set $7g_reason "${7g_reason}:bad_querystring_${bad_querystring_7g}:";
set $7g_drop_bad_query_string 1;
}

if ($bad_request_7g) {
set $7g_reason "${7g_reason}:bad_request_${bad_request_7g}:";
set $7g_drop_bad_request 1;
}

if ($not_allowed_method_7g) {
set $7g_reason "${7g_reason}:not_allowed_method_${not_allowed_method_7g}:";
set $7g_drop_bad_method 2;
}

if ($7g_drop_bad_bot) {
set $args "${7g_reason}";
set $7g_drop 1;
}

if ($7g_drop_bad_referer) {
set $args "${7g_reason}";
set $7g_drop 1;
}

if ($7g_drop_bad_query_string) {
set $args "${7g_reason}";
set $7g_drop 1;
}

if ($7g_drop_bad_request) {
set $args "${7g_reason}";
set $7g_drop 1;
}

if ($7g_drop_bad_method) {
set $args "${7g_reason}";
set $7g_drop 2;
}

if ($7g_drop = 1) {
return 403;
}

if ($7g_drop = 2) {
return 405;
}
Expand Down
Loading

0 comments on commit 7447f1d

Please sign in to comment.