aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/event/php_exporter.php14
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php5
-rw-r--r--phpBB/phpbb/session.php55
3 files changed, 39 insertions, 35 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
index badbbb48fd..35144eeeec 100644
--- a/phpBB/phpbb/event/php_exporter.php
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -253,7 +253,7 @@ class php_exporter
public function get_event_name($event_line, $is_dispatch)
{
$event_text_line = $this->file_lines[$event_line];
- $event_text_line = ltrim($event_text_line, "\t");
+ $event_text_line = ltrim($event_text_line, "\t ");
if ($is_dispatch)
{
@@ -389,7 +389,7 @@ class php_exporter
$found_comment_end = false;
while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**')
{
- if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") === '*/')
+ if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t ") === '*/')
{
$found_comment_end = true;
}
@@ -471,7 +471,7 @@ class php_exporter
{
$find_tag_line = 0;
$found_comment_end = false;
- while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $find_tag . ' ') !== 0)
+ while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0)
{
if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**')
{
@@ -482,7 +482,7 @@ class php_exporter
foreach ($disallowed_tags as $disallowed_tag)
{
- if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $disallowed_tag) === 0)
+ if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $disallowed_tag) === 0)
{
// Found @var after the @since
throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event "
@@ -490,7 +490,7 @@ class php_exporter
}
}
- if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '*/')
+ if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t ") === '*/')
{
$found_comment_end = true;
}
@@ -550,7 +550,7 @@ class php_exporter
public function validate_since($line)
{
$match = array();
- preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t"), $match);
+ preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t "), $match);
if (!isset($match[1]))
{
throw new \LogicException("Invalid '@since' information for event "
@@ -570,7 +570,7 @@ class php_exporter
*/
public function validate_event($event_name, $line)
{
- $event = substr(ltrim($line, "\t"), strlen('* @event '));
+ $event = substr(ltrim($line, "\t "), strlen('* @event '));
if ($event !== trim($event))
{
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 79d68d2ae1..eb53ca6d40 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -256,8 +256,8 @@ class fulltext_sphinx
array('type', $this->dbtype . ' # mysql or pgsql'),
// This config value sql_host needs to be changed incase sphinx and sql are on different servers
array('sql_host', $dbhost . ' # SQL server host sphinx connects to'),
- array('sql_user', $dbuser),
- array('sql_pass', $dbpasswd),
+ array('sql_user', '[dbuser]'),
+ array('sql_pass', '[dbpassword]'),
array('sql_db', $dbname),
array('sql_port', $dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),
array('sql_query_pre', 'SET NAMES \'utf8\''),
@@ -715,6 +715,7 @@ class fulltext_sphinx
),
'ON' => 'p1.topic_id = p2.topic_id',
)),
+ 'WHERE' => 'p2.post_id = ' . ((int) $post_id),
);
$sql = $this->db->sql_build_query('SELECT', $sql_array);
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index da8b848fa5..cf8ea1877e 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -577,32 +577,7 @@ class session
}
}
- $provider_collection = $phpbb_container->get('auth.provider_collection');
- $provider = $provider_collection->get_provider();
- $this->data = $provider->autologin();
-
- if (sizeof($this->data))
- {
- $this->cookie_data['k'] = '';
- $this->cookie_data['u'] = $this->data['user_id'];
- }
-
- // If we're presented with an autologin key we'll join against it.
- // Else if we've been passed a user_id we'll grab data based on that
- if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data))
- {
- $sql = 'SELECT u.*
- FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k
- WHERE u.user_id = ' . (int) $this->cookie_data['u'] . '
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
- AND k.user_id = u.user_id
- AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
- $result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- $bot = false;
- }
- else if ($user_id !== false && !sizeof($this->data))
+ if ($user_id !== false && !sizeof($this->data))
{
$this->cookie_data['k'] = '';
$this->cookie_data['u'] = $user_id;
@@ -616,6 +591,34 @@ class session
$db->sql_freeresult($result);
$bot = false;
}
+ else if (!$bot)
+ {
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $provider = $provider_collection->get_provider();
+ $this->data = $provider->autologin();
+
+ if (sizeof($this->data))
+ {
+ $this->cookie_data['k'] = '';
+ $this->cookie_data['u'] = $this->data['user_id'];
+ }
+
+ // If we're presented with an autologin key we'll join against it.
+ // Else if we've been passed a user_id we'll grab data based on that
+ if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data))
+ {
+ $sql = 'SELECT u.*
+ FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k
+ WHERE u.user_id = ' . (int) $this->cookie_data['u'] . '
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
+ AND k.user_id = u.user_id
+ AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
+ $result = $db->sql_query($sql);
+ $this->data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ $bot = false;
+ }
+ }
// Bot user, if they have a SID in the Request URI we need to get rid of it
// otherwise they'll index this page with the SID, duplicate content oh my!