Skip to content

T15067 Fix controller name parsing route #15770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
- `escapeUrl()` becomes `url()`
- `setHtmlQuoteType()` becomes `setFlags()` [#15757](https://github.com/phalcon/cphalcon/issues/15757)
- Changed `Phalcon\Encryption\Security::hash()` to also use `password_hash()` and accept `ARGON2*` algorithms [#15731](https://github.com/phalcon/cphalcon/issues/15731)
- Removed uncamelize of `realClassName` in `Phalcon\Mvc\Router\Route::getRoutePaths()` if definition is string to make processing same as if array definition [#15067](https://github.com/phalcon/cphalcon/issues/15067)

## Added
- Added more tests in the suite for additional code coverage [#15691](https://github.com/phalcon/cphalcon/issues/15691)
Expand Down
3 changes: 1 addition & 2 deletions phalcon/Mvc/Router/Route.zep
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,7 @@ class Route implements RouteInterface
let realClassName = controllerName;
}

// Always pass the controller to lowercase
let routePaths["controller"] = uncamelize(realClassName);
let routePaths["controller"] = realClassName;
}

// Process action name
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/Mvc/Router/Route/GetRoutePathsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Phalcon\Tests\Integration\Mvc\Router\Route;

use IntegrationTester;
use Phalcon\Mvc\Router\Route;

/**
* Class GetRoutePathsCest
Expand All @@ -29,6 +30,11 @@ class GetRoutePathsCest
public function mvcRouterRouteGetRoutePaths(IntegrationTester $I)
{
$I->wantToTest('Mvc\Router\Route - getRoutePaths()');
$I->skipTest('Need implementation');

$arrayDefinition = ["controller" => 'FooBar', "action" => 'baz'];
$stringDefinition = "FooBar::baz";

$I->assertEquals($arrayDefinition, Route::getRoutePaths($arrayDefinition));
$I->assertEquals($arrayDefinition, Route::getRoutePaths($stringDefinition));
}
}