Skip to content

Commit

Permalink
Merge branch 'dev-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
gondoh committed Feb 24, 2022
2 parents 5745546 + e40e955 commit 4dfd9f2
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 16 deletions.
17 changes: 12 additions & 5 deletions lib/Baser/Network/CakeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*
* `$request['controller']` or `$request->controller`.
*
* @property string $plugin The plugin handling the request. Will be `null` when there is no plugin.
* @property string $controller The controller handling the current request.
* @property string $action The action handling the current request.
* @property array $named Array of named parameters parsed from the URL.
* @property array $pass Array of passed arguments parsed from the URL.
* @package Cake.Network
*/
class CakeRequest implements ArrayAccess {
Expand Down Expand Up @@ -253,13 +258,15 @@ protected function _url() {
} else {
// CUSTOMIZE MODIFY 2019/09/18 CUiwamoto
// urlのアクション部分にフルパスが来るとトップページに遷移してしまう為、404となるように修正
// CUSTOMIZE MODIFY 2021/10/07 Yamamoto
// オリジナルCakePHPの修正に揃える(得られる結果は同じ)
// https://github.com/cakephp/cakephp/commit/63d708118acd3db9c1286d8bbb86c9a3cd5aae66
// >>>
// $uri = substr($_SERVER['REQUEST_URI'], strlen(Configure::read('App.fullBaseUrl')));
// ---
if (strpos($_SERVER['REQUEST_URI'], Configure::read('App.fullBaseUrl')) === 0) {
$uri = substr($_SERVER['REQUEST_URI'], strlen(Configure::read('App.fullBaseUrl')));
$baseUrl = Configure::read('App.fullBaseUrl');
if (substr($_SERVER['REQUEST_URI'], 0, strlen($baseUrl)) === $baseUrl) {
$uri = substr($_SERVER['REQUEST_URI'], strlen($baseUrl));
} else {
$uri = $_SERVER['REQUEST_URI'];
$uri = $_SERVER['REQUEST_URI']; // ここだけオリジナルCakePHPと違う by Yamamoto
}
// <<<
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Baser/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4.5.5
4.5.6

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// +---------------------------------------------------------------------------------------------------+ //
Expand All @@ -16,6 +16,9 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////
CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加

[2022-02-24] basercms-4.5.6
- CHG: [BC] CakePHP 2.10.24 にアップデート

[2022-01-27] basercms-4.5.5
- CHG: [BC] ユーザーEメールの重複チェックを追加
- CHG: [BC] fix #1410 パスワードの変更処理の仕様改善
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/CompletionShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getOptionParser() {
*/
protected function _output($options = array()) {
if ($options) {
return $this->out(implode($options, ' '));
return $this->out(implode(' ', $options));
}
}
}
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/SchemaShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function startup() {
$this->out('Cake Schema Shell');
$this->hr();

Configure::write('Cache.disable', 1);
Configure::write('Cache.disable', true);

$name = $path = $connection = $plugin = null;
if (!empty($this->params['name'])) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/Command/TestShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ protected function _run($runnerArgs, $options = array()) {
public function available() {
$params = $this->_parseArgs();
$testCases = CakeTestLoader::generateTestList($params);
$app = $params['app'];
$plugin = $params['plugin'];
$app = isset($params['app']) ? $params['app'] : null;
$plugin = isset($params['plugin']) ? $params['plugin'] : null;

$title = "Core Test Cases:";
$category = 'core';
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/I18n/L10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class L10n {
'fi' => array('language' => 'Finnish', 'locale' => 'fin', 'localeFallback' => 'fin', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fi-fi' => array('language' => 'Finnish (Finland)', 'locale' => 'fi_fi', 'localeFallback' => 'fin', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fo' => array('language' => 'Faeroese', 'locale' => 'fao', 'localeFallback' => 'fao', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fo-fo' => array('language' => 'Faeroese (Faroe Island)', 'locale' => 'fo_fo', 'localeFallback' => 'fao', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fr' => array('language' => 'French (Standard)', 'locale' => 'fra', 'localeFallback' => 'fra', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fr-be' => array('language' => 'French (Belgium)', 'locale' => 'fr_be', 'localeFallback' => 'fra', 'charset' => 'utf-8', 'direction' => 'ltr'),
'fr-ca' => array('language' => 'French (Canadian)', 'locale' => 'fr_ca', 'localeFallback' => 'fra', 'charset' => 'utf-8', 'direction' => 'ltr'),
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Network/CakeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ protected function _url() {
if ($qPosition !== false && strpos($_SERVER['REQUEST_URI'], '://') > $qPosition) {
$uri = $_SERVER['REQUEST_URI'];
} else {
$uri = substr($_SERVER['REQUEST_URI'], strlen(Configure::read('App.fullBaseUrl')));
$baseUrl = Configure::read('App.fullBaseUrl');
if (substr($_SERVER['REQUEST_URI'], 0, strlen($baseUrl)) === $baseUrl) {
$uri = substr($_SERVER['REQUEST_URI'], strlen($baseUrl));
}
}
} elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['SCRIPT_NAME'])) {
$uri = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);
Expand Down
7 changes: 6 additions & 1 deletion lib/Cake/Test/Case/Network/CakeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,14 @@ public function testQueryStringAndNamedParams() {
$request = new CakeRequest();
$this->assertEquals('some/path', $request->url);

$_SERVER['REQUEST_URI'] = Configure::read('App.fullBaseUrl') . '/other/path?url=https://cakephp.org';
$base = Configure::read('App.fullBaseUrl');
$_SERVER['REQUEST_URI'] = $base . '/other/path?url=https://cakephp.org';
$request = new CakeRequest();
$this->assertEquals('other/path', $request->url);

$_SERVER['REQUEST_URI'] = str_repeat('x', strlen($base) - 4) . '://?/other/path';
$request = new CakeRequest();
$this->assertEquals('', $request->url);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/ObjectCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function trigger($callback, $params = array(), $options = array()) {
}
$result = null;
foreach ($list as $name) {
$result = call_user_func_array(array($this->_loaded[$name], $callback), array_filter(compact('subject')) + $params);
$result = call_user_func_array(array($this->_loaded[$name], $callback), array_values(array_filter(compact('subject')) + $params));
if ($options['collectReturn'] === true) {
$collected[] = $result;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
// @license https://opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
2.10.22
2.10.24
4 changes: 2 additions & 2 deletions lib/Cake/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ public function secure($fields = array(), $secureAttributes = array()) {
ksort($locked, SORT_STRING);
$fields += $locked;

$locked = implode(array_keys($locked), '|');
$unlocked = implode($unlockedFields, '|');
$locked = implode('|', array_keys($locked));
$unlocked = implode('|', $unlockedFields);
$hashParts = array(
$this->_lastAction,
serialize($fields),
Expand Down

0 comments on commit 4dfd9f2

Please sign in to comment.