aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/.htaccess56
-rw-r--r--phpBB/docs/events.md16
-rw-r--r--phpBB/memberlist.php2
-rw-r--r--phpBB/phpbb/controller/provider.php2
-rw-r--r--phpBB/phpbb/template/twig/lexer.php15
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html3
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html2
-rw-r--r--phpBB/viewtopic.php6
8 files changed, 83 insertions, 19 deletions
diff --git a/phpBB/.htaccess b/phpBB/.htaccess
index 6f33916775..1ae74ed825 100644
--- a/phpBB/.htaccess
+++ b/phpBB/.htaccess
@@ -26,12 +26,50 @@ RewriteRule ^(.*)$ app.php [QSA,L]
#Options +FollowSymLinks
</IfModule>
-<Files "config.php">
-Order Allow,Deny
-Deny from All
-</Files>
-
-<Files "common.php">
-Order Allow,Deny
-Deny from All
-</Files>
+# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
+# module mod_authz_host to a new module called mod_access_compat (which may be
+# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
+# We could just conditionally provide both versions, but unfortunately Apache
+# does not explicitly tell us its version if the module mod_version is not
+# available. In this case, we check for the availability of module
+# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
+<IfModule mod_version.c>
+ <IfVersion < 2.4>
+ <Files "config.php">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ <Files "common.php">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfVersion>
+ <IfVersion >= 2.4>
+ <Files "config.php">
+ Require all denied
+ </Files>
+ <Files "common.php">
+ Require all denied
+ </Files>
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ <IfModule !mod_authz_core.c>
+ <Files "config.php">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ <Files "common.php">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfModule>
+ <IfModule mod_authz_core.c>
+ <Files "config.php">
+ Require all denied
+ </Files>
+ <Files "common.php">
+ Require all denied
+ </Files>
+ </IfModule>
+</IfModule>
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 67fa96ffbc..1cc1300c05 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -667,6 +667,22 @@ viewtopic_print_head_append
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen
+viewtopic_body_contact_fields_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add data after the contact fields on the user profile when viewing
+a post
+
+viewtopic_body_contact_fields_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add data before the contact fields on the user profile when viewing
+a post
+
viewtopic_body_footer_before
===
* Locations:
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 9c6b3d278f..82143d44cb 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1731,7 +1731,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
$data['user_type'] != USER_IGNORE &&
// They must not be deactivated by the administrator
- ($data['user_type'] != USER_INACTIVE && $data['user_inactive_reason'] == INACTIVE_MANUAL) &&
+ ($data['user_type'] != USER_INACTIVE || $data['user_inactive_reason'] != INACTIVE_MANUAL) &&
// They must be able to read PMs
sizeof($auth->acl_get_list($user_id, 'u_readpm')) &&
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php
index 9df8130210..2c7493f64c 100644
--- a/phpBB/phpbb/controller/provider.php
+++ b/phpBB/phpbb/controller/provider.php
@@ -46,7 +46,7 @@ class provider
// We hardcode the path to the core config directory
// because the finder cannot find it
$this->routing_files = array_merge($this->routing_files, array('config/routing.yml'), array_keys($finder
- ->directory('config')
+ ->directory('/config')
->suffix('routing.yml')
->find()
));
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index f4efc58540..49577f6e95 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -191,9 +191,16 @@ class lexer extends \Twig_Lexer
$parent_class = $this;
$callback = function ($matches) use ($parent_class, $parent_nodes)
{
- $name = $matches[1];
- $subset = trim(substr($matches[2], 1, -1)); // Remove parenthesis
- $body = $matches[3];
+ $hard_parents = explode('.', $matches[1]);
+ array_pop($hard_parents); // ends with .
+ if ($hard_parents)
+ {
+ $parent_nodes = array_merge($hard_parents, $parent_nodes);
+ }
+
+ $name = $matches[2];
+ $subset = trim(substr($matches[3], 1, -1)); // Remove parenthesis
+ $body = $matches[4];
// Replace <!-- BEGINELSE -->
$body = str_replace('<!-- BEGINELSE -->', '{% else %}', $body);
@@ -242,7 +249,7 @@ class lexer extends \Twig_Lexer
return "{% for {$name} in {$parent}{$name}{$subset} %}{$body}{% endfor %}";
};
- return preg_replace_callback('#<!-- BEGIN ([!a-zA-Z0-9_]+)(\([0-9,\-]+\))? -->(.+?)<!-- END \1 -->#s', $callback, $code);
+ return preg_replace_callback('#<!-- BEGIN ((?:[a-zA-Z0-9_]+\.)*)([!a-zA-Z0-9_]+)(\([0-9,\-]+\))? -->(.+?)<!-- END \1\2 -->#s', $callback, $code);
}
/**
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 627b5aa6ed..81171e97b2 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -33,7 +33,7 @@
<!-- END custom_fields -->
<!-- EVENT ucp_pm_viewmessage_custom_fields_after -->
-
+ <!-- EVENT ucp_pm_viewmessage_contact_fields_before -->
<!-- IF .contact -->
<dd class="profile-contact">
<strong>{L_CONTACT_USER}{L_COLON}</strong>
@@ -59,6 +59,7 @@
</div>
</dd>
<!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_contact_fields_after -->
</dl>
<div class="postbody">
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 485083a2ba..8912382c48 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -143,6 +143,7 @@
<!-- END custom_fields -->
<!-- EVENT viewtopic_body_postrow_custom_fields_after -->
+ <!-- EVENT viewtopic_body_contact_fields_before -->
<!-- IF not S_IS_BOT and .postrow.contact -->
<dd class="profile-contact">
<strong>{L_CONTACT_USER}{L_COLON}</strong>
@@ -169,6 +170,7 @@
</div>
</dd>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_contact_fields_after -->
</dl>
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 0691355563..1f59019245 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1609,7 +1609,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$user_cache[$poster_id]['user_type'] != USER_IGNORE &&
// They must not be deactivated by the administrator
- ($user_cache[$poster_id]['user_type'] != USER_INACTIVE && $user_cache[$poster_id]['user_inactive_reason'] == INACTIVE_MANUAL) &&
+ ($user_cache[$poster_id]['user_type'] != USER_INACTIVE || $user_cache[$poster_id]['user_inactive_reason'] != INACTIVE_MANUAL) &&
// They must be able to read PMs
in_array($poster_id, $can_receive_pm_list) &&
@@ -1618,10 +1618,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
!in_array($poster_id, $permanently_banned_users) &&
// They must allow users to contact via PM
- (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm'])
+ (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $user_cache[$poster_id]['allow_pm'])
);
- $u_pm = '';
+ $u_pm = '';
if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm)
{