diff --git a/git-tools/merge.php b/git-tools/merge.php
index 41a96c0890..f6142095fb 100755
--- a/git-tools/merge.php
+++ b/git-tools/merge.php
@@ -124,19 +124,34 @@ function get_repository_url($username, $repository, $ssh = false)
function api_request($query)
{
- $contents = file_get_contents("http://github.com/api/v2/json/$query");
+ return api_url_request("https://api.github.com/$query?per_page=100");
+}
+
+function api_url_request($url)
+{
+ $contents = file_get_contents($url, false, stream_context_create(array(
+ 'http' => array(
+ 'header' => "User-Agent: phpBB/1.0\r\n",
+ ),
+ )));
if ($contents === false)
{
throw new RuntimeException("Error: failed to retrieve pull request data\n", 4);
}
+ $contents = json_decode($contents);
- return json_decode($contents);
+ if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
+ {
+ throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
+ }
+
+ return $contents;
}
function get_pull($username, $repository, $pull_id)
{
- $request = api_request("pulls/$username/$repository/$pull_id");
+ $request = api_request("repos/$username/$repository/pulls/$pull_id");
$pull = $request->pull;
diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php
index 5f2e1609a7..4e144edae6 100755
--- a/git-tools/setup_github_network.php
+++ b/git-tools/setup_github_network.php
@@ -15,14 +15,14 @@ function show_usage()
echo "$filename adds repositories of a github network as remotes to a local git repository.\n";
echo "\n";
- echo "Usage: [php] $filename -s collaborators|organisation|contributors|network [OPTIONS]\n";
+ echo "Usage: [php] $filename -s collaborators|organisation|contributors|forks [OPTIONS]\n";
echo "\n";
echo "Scopes:\n";
echo " collaborators Repositories of people who have push access to the specified repository\n";
echo " contributors Repositories of people who have contributed to the specified repository\n";
echo " organisation Repositories of members of the organisation at github\n";
- echo " network All repositories of the whole github network\n";
+ echo " forks All repositories of the whole github network\n";
echo "\n";
echo "Options:\n";
@@ -55,31 +55,31 @@ exit(work($scope, $username, $repository, $developer));
function work($scope, $username, $repository, $developer)
{
// Get some basic data
- $network = get_network($username, $repository);
+ $forks = get_forks($username, $repository);
$collaborators = get_collaborators($username, $repository);
- if ($network === false || $collaborators === false)
+ if ($forks === false || $collaborators === false)
{
- echo "Error: failed to retrieve network or collaborators\n";
+ echo "Error: failed to retrieve forks or collaborators\n";
return 1;
}
switch ($scope)
{
case 'collaborators':
- $remotes = array_intersect_key($network, $collaborators);
+ $remotes = array_intersect_key($forks, $collaborators);
break;
case 'organisation':
- $remotes = array_intersect_key($network, get_organisation_members($username));
+ $remotes = array_intersect_key($forks, get_organisation_members($username));
break;
case 'contributors':
- $remotes = array_intersect_key($network, get_contributors($username, $repository));
+ $remotes = array_intersect_key($forks, get_contributors($username, $repository));
break;
- case 'network':
- $remotes = $network;
+ case 'forks':
+ $remotes = $forks;
break;
default:
@@ -145,26 +145,66 @@ function get_repository_url($username, $repository, $ssh = false)
function api_request($query)
{
- $contents = file_get_contents("http://github.com/api/v2/json/$query");
+ return api_url_request("https://api.github.com/$query?per_page=100");
+}
+
+function api_url_request($url)
+{
+ $contents = file_get_contents($url, false, stream_context_create(array(
+ 'http' => array(
+ 'header' => "User-Agent: phpBB/1.0\r\n",
+ ),
+ )));
+
+ $sub_request_result = array();
+ // Check headers for pagination links
+ if (!empty($http_response_header))
+ {
+ foreach ($http_response_header as $header_element)
+ {
+ // Find Link Header which gives us a link to the next page
+ if (strpos($header_element, 'Link: ') === 0)
+ {
+ list($head, $header_content) = explode(': ', $header_element);
+ foreach (explode(', ', $header_content) as $links)
+ {
+ list($url, $rel) = explode('; ', $links);
+ if ($rel == 'rel="next"')
+ {
+ // Found a next link, follow it and merge the results
+ $sub_request_result = api_url_request(substr($url, 1, -1));
+ }
+ }
+ }
+ }
+ }
+
if ($contents === false)
{
return false;
}
- return json_decode($contents);
+ $contents = json_decode($contents);
+
+ if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
+ {
+ throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
+ }
+
+ return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents;
}
function get_contributors($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/contributors");
+ $request = api_request("repos/$username/$repository/stats/contributors");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->contributors as $contributor)
+ foreach ($request as $contribution)
{
- $usernames[$contributor->login] = $contributor->login;
+ $usernames[$contribution->author->login] = $contribution->author->login;
}
return $usernames;
@@ -172,14 +212,14 @@ function get_contributors($username, $repository)
function get_organisation_members($username)
{
- $request = api_request("organizations/$username/public_members");
+ $request = api_request("orgs/$username/public_members");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->users as $member)
+ foreach ($request as $member)
{
$usernames[$member->login] = $member->login;
}
@@ -189,35 +229,35 @@ function get_organisation_members($username)
function get_collaborators($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/collaborators");
+ $request = api_request("repos/$username/$repository/collaborators");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->collaborators as $collaborator)
+ foreach ($request as $collaborator)
{
- $usernames[$collaborator] = $collaborator;
+ $usernames[$collaborator->login] = $collaborator->login;
}
return $usernames;
}
-function get_network($username, $repository)
+function get_forks($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/network");
+ $request = api_request("repos/$username/$repository/forks");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->network as $network)
+ foreach ($request as $fork)
{
- $usernames[$network->owner] = array(
- 'username' => $network->owner,
- 'repository' => $network->name,
+ $usernames[$fork->owner->login] = array(
+ 'username' => $fork->owner->login,
+ 'repository' => $fork->name,
);
}
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 164c4a2f55..95a2f56825 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -34,7 +34,7 @@
-
Thank you for downloading phpBB3. This README will guide through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully before proceeding with the installation.
+
Thank you for downloading phpBB3. This README will guide you through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully before proceeding with the installation.
Installation, update and conversion instructions can be found in the INSTALL document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x or 3.0.x installation we highly recommend you backup any existing data before proceeding!
+
Installation, update and conversion instructions can be found in the INSTALL document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!
Users of phpBB 3.0 and 3.1 Beta versions cannot directly update.
-
Please note that we won't support the following installation types:
+
Please note that we don't support the following installation types:
Updates from phpBB 3.0 Beta versions to phpBB 3.0 RC1 and higher
Updates from phpBB 3.1 Beta versions to phpBB 3.1 RC1 and higher
@@ -103,8 +102,8 @@
Updates from phpBB 3.0 RC1 and 3.1 RC1 to the latest version
Note: if using the Automatic Update Package, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.
Conversions from phpBB 2.0.x to the latest version
-
New installations of phpBB 3.0.x - always only the latest released version
-
New installations of phpBB 3.1.x - always only the latest released version
+
New installations of phpBB 3.0.x - only the latest released version
+
New installations of phpBB 3.1.x - only the latest released version
This is the official location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. So please, do not ask for help in these cases!
+
This is the official location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. Please do not ask for support if you download a language pack from a 3rd party site.
Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included language and styles folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: System tab -> General Tasks -> Language packs. A more detailed description of the process is in the Knowledge Base article, How to Install a Language Pack.
@@ -175,15 +174,15 @@
-
phpBB3 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the FAQ which covers a few basic getting started questions. If you need additional help there are several places you should look.
+
phpBB3 can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the FAQ, which covers a few basic getting started questions. If you need additional help there are several places you can find it.
3.i. phpBB3 Documentation
-
A comprehensive documentation is now available online and can be accessed from the following location:
+
Comprehensive documentation is now available on the phpBB website:
If you do seek help via our forums please be sure to do a Search before posting. This may well save both you and us time and allow the developer, moderator and support groups to spend more time responding to people with unknown issues and problems. Please also remember that phpBB is an entirely volunteer effort, no one receives any compensation for the time they give, this includes moderators as well as developers. So please be respectful and mindful when awaiting responses.
+
If you do seek help via our forums please be sure to do a search before posting; if someone has experienced the issue before, then you may find that your question has already been answered. Please remember that phpBB is entirely staffed by volunteers, no one receives any compensation for the time they give, including moderators as well as developers; please be respectful and mindful when awaiting responses and receiving support.
3.iv Internet Relay Chat
@@ -268,7 +267,7 @@
The relevant database type/version is listed within the administration control panel.
-
Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request on GitHub.
+
Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository on GitHub.
If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.1.x the coding guidelines may be found here: http://area51.phpbb.com/docs/31x/coding-guidelines.html
@@ -299,8 +298,8 @@
This list is not complete but does represent those bugs which may affect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.
-
Conversions may fail to complete on large boards under some hosts
-
Updates may fail to complete on large update sets under some hosts
+
Conversions may fail to complete on large boards under some hosts.
+
Updates may fail to complete on large update sets under some hosts.
Smilies placed directly after bbcode tags will not get parsed. Smilies always need to be separated by spaces.
@@ -322,7 +321,7 @@
phpBB 3.1.x takes advantage of new features added in PHP 5.3. We recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.3.
-
Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.
+
Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.
This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 5.3.x to 5.4.x without problem.
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index eee2090da0..cf7128b25b 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -279,7 +279,7 @@ else if ($download_id)
phpbb_increment_downloads($db, $attachment['attach_id']);
}
- if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false)))
+ if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))
{
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
file_gc();
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 847ccfb3cc..c79699d465 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -591,7 +591,7 @@ class acp_groups
$avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true);
- if (!$update)
+ if (isset($phpbb_avatar_manager) && !$update)
{
// Merge any avatar errors into the primary error array
$error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
diff --git a/phpBB/includes/db/driver/mssql_odbc.php b/phpBB/includes/db/driver/mssql_odbc.php
index cde9d332ba..a1d1a5d5dd 100644
--- a/phpBB/includes/db/driver/mssql_odbc.php
+++ b/phpBB/includes/db/driver/mssql_odbc.php
@@ -253,7 +253,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver_mssql_base
* Fetch current row
* @note number of bytes returned depends on odbc.defaultlrl php.ini setting. If it is limited to 4K for example only 4K of data is returned max.
*/
- function sql_fetchrow($query_id = false, $debug = false)
+ function sql_fetchrow($query_id = false)
{
global $cache;
diff --git a/phpBB/includes/db/driver/mssqlnative.php b/phpBB/includes/db/driver/mssqlnative.php
index 6f433e10cf..28fc88298a 100644
--- a/phpBB/includes/db/driver/mssqlnative.php
+++ b/phpBB/includes/db/driver/mssqlnative.php
@@ -326,7 +326,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver_mssql_base
$this->sql_report('stop', $query);
}
- if ($cache_ttl)
+ if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
@@ -394,7 +394,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver_mssql_base
*/
function sql_affectedrows()
{
- return (!empty($this->query_result)) ? @sqlsrv_rows_affected($this->query_result) : false;
+ return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->query_result) : false;
}
/**
@@ -409,7 +409,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver_mssql_base
$query_id = $this->query_result;
}
- if ($cache->sql_exists($query_id))
+ if ($cache && $cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -474,9 +474,9 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver_mssql_base
return $cache->sql_freeresult($query_id);
}
- if (isset($this->open_queries[$query_id]))
+ if (isset($this->open_queries[(int) $query_id]))
{
- unset($this->open_queries[$query_id]);
+ unset($this->open_queries[(int) $query_id]);
return @sqlsrv_free_stmt($query_id);
}
return false;
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index ee4e2f5135..0a8000ea3d 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -46,7 +46,7 @@ function send_avatar_to_browser($file, $browser)
$image_data = @getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
- if (strpos(strtolower($browser), 'msie') !== false && strpos(strtolower($browser), 'msie 8.0') === false)
+ if ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
{
header('Content-Disposition: attachment; ' . header_filename($file));
@@ -174,10 +174,9 @@ function send_file_to_browser($attachment, $upload_dir, $category)
header('Pragma: public');
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
- $is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
header('Content-Type: ' . $attachment['mimetype']);
- if ($is_ie8)
+ if (phpbb_is_greater_ie_version($user->browser, 7))
{
header('X-Content-Type-Options: nosniff');
}
@@ -189,7 +188,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
else
{
- if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
+ if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
{
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
@@ -200,7 +199,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
else
{
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
+ if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('X-Download-Options: noopen');
}
@@ -410,7 +409,8 @@ function set_modified_headers($stamp, $browser)
// let's see if we have to send the file at all
$last_load = $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false;
- if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false))
+
+ if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
{
if ($last_load !== false && $last_load >= $stamp)
{
@@ -721,3 +721,24 @@ function phpbb_download_clean_filename($filename)
return $filename;
}
+
+/**
+* Check if the browser is internet explorer version 7+
+*
+* @param string $user_agent User agent HTTP header
+* @param int $version IE version to check against
+*
+* @return bool true if internet explorer version is greater than $version
+*/
+function phpbb_is_greater_ie_version($user_agent, $version)
+{
+ if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches))
+ {
+ $ie_version = (int) $matches[1];
+ return ($ie_version > $version);
+ }
+ else
+ {
+ return false;
+ }
+}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 7b11e4f01b..1b598f7bf7 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1653,7 +1653,7 @@ function validate_username($username, $allowed_username = false)
*/
function validate_password($password)
{
- global $config, $db, $user;
+ global $config;
if ($password === '' || $config['pass_complex'] === 'PASS_TYPE_ANY')
{
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index af08533a7d..aada0525a8 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -691,7 +691,7 @@ class ucp_groups
}
}
- if (!$update)
+ if (isset($phpbb_avatar_manager) && !$update)
{
// Merge any avatars errors into the primary error array
$error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 2b826497da..97769b6155 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -74,6 +74,10 @@ function insert_single(user)
+