Skip to content

Commit

Permalink
Merge pull request #3802 from Spuds/Patch_1_1_10
Browse files Browse the repository at this point in the history
Patch 1 1 10
  • Loading branch information
Spuds authored Jun 4, 2024
2 parents e8bd084 + 0863f63 commit 1e032aa
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/setup-elkarte.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi

# Phpunit and support
# composer config --file=composer2.json && composer install --no-interaction --quiet
composer install --no-interaction --quiet
composer install --no-interaction
if [[ "$PHP_VERSION" =~ ^8 ]]
then
composer remove phpunit/phpunit phpunit/phpunit-selenium --dev --update-with-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request: # Run tests when pull requests are made on these branches
branches:
- master
- 'patch_1-1-9'
- 'patch_1-1-10'

env:
WEBSERVER: 'none'
Expand Down
14 changes: 5 additions & 9 deletions sources/controllers/ProfileHistory.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.1.9
* @version 1.1.10
*
*/

Expand Down Expand Up @@ -433,25 +433,21 @@ public function action_trackip()
if ($context['single_ip'])
{
$context['whois_servers'] = array(
'afrinic' => array(
'name' => $txt['whois_afrinic'],
'url' => 'http://www.afrinic.net/whois?searchtext=' . $context['ip'],
),
'apnic' => array(
'name' => $txt['whois_apnic'],
'url' => 'http://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'],
'url' => 'https://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'],
),
'arin' => array(
'name' => $txt['whois_arin'],
'url' => 'http://whois.arin.net/rest/ip/' . $context['ip'],
'url' => 'https://whois.arin.net/rest/ip/' . $context['ip'],
),
'lacnic' => array(
'name' => $txt['whois_lacnic'],
'url' => 'http://lacnic.net/cgi-bin/lacnic/whois?query=' . $context['ip'],
'url' => 'https://query.milacnic.lacnic.net/search?id=' . $context['ip'],
),
'ripe' => array(
'name' => $txt['whois_ripe'],
'url' => 'https://apps.db.ripe.net/search/query.html?searchtext=' . $context['ip'],
'url' => 'https://apps.db.ripe.net/db-web-ui/query?searchtext=' . $context['ip'],
),
);

Expand Down
9 changes: 8 additions & 1 deletion sources/subs/Auth.subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.1.7
* @version 1.1.10
*
*/

Expand Down Expand Up @@ -543,6 +543,13 @@ function validatePassword($password, $username, $restrict_in = array())
return 'short';
}

if (Util::strlen($password) > 64)
{
loadLanguage('Errors');
$txt['profile_error_password_long'] = sprintf($txt['profile_error_password_long'], 64);
return 'short';
}

// Is this enough?
if (empty($modSettings['password_strength']))
return null;
Expand Down
24 changes: 15 additions & 9 deletions tests/sources/subs/Curl_Fetch_Webdata.class.Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ protected function setUp(): void
// expected return code
// expected in output
$this->curl_post_testcases = array(
array(
'https://www.google.com',
array('gs_taif0' => 'elkarte'),
405,
'all we know',
),
//array(
// 'https://www.google.com',
// array('gs_taif0' => 'elkarte'),
// 405,
// 'all we know',
//),
array(
'https://duckduckgo.com/html',
array('q' => 'elkarte', 'ia' => 'about'),
200,
[200, 403],
'Free and Open',
),
);
Expand Down Expand Up @@ -89,11 +89,17 @@ public function testPost()
// Post to a page
$curl->get_url_data($testcase[0], $testcase[1]);


// Check for correct fetch
if (!empty($testcase[2]))
$this->assertEquals($testcase[2], $curl->result('code'));
if (!empty($testcase[3]))
{
$this->assertContains($curl->result('code'), $testcase[2]);
}

if (!empty($testcase[3]) && $curl->result('code') == 200)
{
$this->assertStringContainsString($testcase[3], $curl->result('body'));
}
}
}
}
1 change: 1 addition & 0 deletions themes/default/ProfileOptions.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ function template_authentication_method()
<script>
var regTextStrings = {
"password_short": "', $txt['registration_password_short'], '",
"password_long": "', $txt['registration_password_long'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
Expand Down
3 changes: 2 additions & 1 deletion themes/default/Register.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.1.9
* @version 1.1.10
*
*/

Expand Down Expand Up @@ -504,6 +504,7 @@ function verifyAgree()
"username_invalid": "', $txt['registration_username_unavailable'], '",
"username_check": "', $txt['registration_username_check'], '",
"password_short": "', $txt['registration_password_short'], '",
"password_long": "', $txt['registration_password_long'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
Expand Down
4 changes: 3 additions & 1 deletion themes/default/Reminder.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.1
* @version 1.1.10
*
*/

Expand Down Expand Up @@ -146,6 +146,7 @@ function template_set_password()
<script>
var regTextStrings = {
"password_short": "', $txt['registration_password_short'], '",
"password_long": "', $txt['registration_password_long'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
Expand Down Expand Up @@ -219,6 +220,7 @@ function template_ask()
<script>
var regTextStrings = {
"password_short": "', $txt['registration_password_short'], '",
"password_long": "', $txt['registration_password_long'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
Expand Down
3 changes: 2 additions & 1 deletion themes/default/languages/english/Errors.english.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Version: 1.1; Errors
// Version: 1.1.10; Errors

$txt['no_access'] = 'Sorry, we can\'t let you access this section. We can\'t even tell you if it exists. You\'re welcome to visit the main page and choose your way from there.';
$txt['not_guests'] = 'Sorry, this action is not available to guests.';
Expand Down Expand Up @@ -327,6 +327,7 @@
$txt['profile_error_bad_password'] = 'The password you entered was not correct';
$txt['profile_error_bad_avatar'] = 'The avatar you have selected is either too large or not an avatar';
$txt['profile_error_password_short'] = 'Your password must be at least %1$s characters long.';
$txt['profile_error_password_long'] = 'Your password must be no more than %1$s characters long.';
$txt['profile_error_password_restricted_words'] = 'Your password must not contain your user name, email address or other commonly used words.';
$txt['profile_error_password_chars'] = 'Your password must contain a mix of upper and lower case letters, as well as digits.';
$txt['profile_error_already_requested_group'] = 'You already have an outstanding request for this group!';
Expand Down
3 changes: 2 additions & 1 deletion themes/default/languages/english/Login.english.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Version: 1.1; Login
// Version: 1.1.10; Login

// Registration agreement page.
$txt['registration_agreement'] = 'Registration Agreement';
Expand Down Expand Up @@ -137,6 +137,7 @@
$txt['registration_username_unavailable'] = 'Username is not available';
$txt['registration_username_check'] = 'Check if username is available';
$txt['registration_password_short'] = 'Password is too short';
$txt['registration_password_long'] = 'Password is too long';
$txt['registration_password_reserved'] = 'Password contains your username/email';
$txt['registration_password_numbercase'] = 'Password must contain both upper and lower case, and numbers';
$txt['registration_password_no_match'] = 'Passwords do not match';
Expand Down
5 changes: 4 additions & 1 deletion themes/default/scripts/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.1
* @version 1.1.10
*/

/**
Expand Down Expand Up @@ -157,6 +157,9 @@ elkRegister.prototype.refreshMainPassword = function(called_from_verify)
if ((curPass.length < 8 && this.passwordLevel >= 1) || curPass.length < 4)
stringIndex = 'password_short';

if (curPass.length > 64)
stringIndex = 'password_long';

// More than basic?
if (this.passwordLevel >= 1)
{
Expand Down

0 comments on commit 1e032aa

Please sign in to comment.