Skip to content
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

fixed the bug in Module->createController #320

Closed
callmez opened this issue May 20, 2013 · 4 comments
Closed

fixed the bug in Module->createController #320

callmez opened this issue May 20, 2013 · 4 comments
Assignees
Labels

Comments

@callmez
Copy link
Contributor

callmez commented May 20, 2013

if ($route === '') {
            $route = $this->defaultRoute;
        }
        if (($pos = strpos($route, '/')) !== false) {
            $id = substr($route, 0, $pos);
            $route = (string)substr($route, $pos + 1); //this value must return string type
        } else {
            $id = $route;
            $route = '';
        }
@samdark
Copy link
Member

samdark commented May 20, 2013

How can it return non-string?

@callmez
Copy link
Contributor Author

callmez commented May 20, 2013

if url is index.php?r=member/, member is a module of my app, php will throw exception!
$route will get a (boolean)false value.

@ghost ghost assigned qiangxue May 20, 2013
@callmez
Copy link
Contributor Author

callmez commented May 20, 2013

in yii1 CWebApplication->createController line 326
same thing force return string

qiangxue added a commit that referenced this issue May 20, 2013
@qiangxue
Copy link
Member

Fixed. Thanks!

cebe added a commit that referenced this issue May 20, 2013
* 'master' of github.com:yiisoft/yii2: (31 commits)
  Finished bootstrap Widget and Modal.
  PHP Intl extension has been added to default Yii requirements.
  moved optional packages to "suggest", updated platform requirements
  "vendor-dir": "vendor" is default, removed
  Fixes issue #320: Module::createController() will fail with a route with trailing slash.
  Fixed test break about AssetController.
  requirements css.php twitter bootstrap update to 2.3.2
  Twitter bootstrap updated to 2.3.2
  Modified the IAssetConvert interface.
  hashing the key for registerCss and registerJs.
  Update AccessRule.php
  refactored code after feedback
  Fixed framework path.
  Added support for View::POS_READY.
  new proposed structure
  remove from master (update track)
  minor fixes
  updated the README file of the bootstrap app.
  Inflector class
  readjusting files for the framework package.
  ...
tonydspaniard added a commit to tonydspaniard/yii2 that referenced this issue May 21, 2013
* upstream:
  Fixes issue yiisoft#320: Module::createController() will fail with a route with trailing slash.
  Fixed test break about AssetController.
  requirements css.php twitter bootstrap update to 2.3.2
  Twitter bootstrap updated to 2.3.2
  Modified the IAssetConvert interface.
  hashing the key for registerCss and registerJs.
  Update AccessRule.php
  refactored code after feedback
  Fixed framework path.
  Added support for View::POS_READY.
  new proposed structure
  remove from master (update track)
  made some changes, fix some pitfalls, remove PHP_EOL
  yiisoft#20 proposed architecture for bootstrap

Conflicts:
	yii/helpers/base/Inflector.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants