-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1259 from sjinks/1.2.4
Fix #1258
- Loading branch information
Showing
13 changed files
with
157 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--TEST-- | ||
Segmentation fault in zim_Phalcon_Mvc_Dispatcher__throwDispatchException - https://github.com/phalcon/cphalcon/issues/1258 | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
class Secure extends Phalcon\Mvc\User\Plugin | ||
{ | ||
public function beforeDispatch(\Phalcon\Events\Event $event, \Phalcon\Mvc\Dispatcher $dispatcher) | ||
{ | ||
$acl = new \Phalcon\Acl\Adapter\Memory(); | ||
$acl->setDefaultAction(Phalcon\Acl::ALLOW); | ||
$acl->addRole(new \Phalcon\Acl\Role('test')); | ||
|
||
$acl->isAllowed('test' , 'test' , 'test'); | ||
$acl->isAllowed('test' , 'test' , 'test'); | ||
} | ||
} | ||
|
||
$di = new \Phalcon\DI\FactoryDefault(); | ||
$di->set( | ||
'dispatcher', | ||
function () use ($di) { | ||
$eventsManager = $di->getShared('eventsManager'); | ||
|
||
$secure = new \Secure($di); | ||
$eventsManager->attach('dispatch' , $secure); | ||
|
||
$dispatcher = new \Phalcon\Mvc\Dispatcher(); | ||
$dispatcher->setEventsManager($eventsManager); | ||
|
||
return $dispatcher; | ||
} | ||
); | ||
|
||
$di['view'] = function(){ | ||
return new Phalcon\Mvc\View(); | ||
}; | ||
|
||
$application = new \Phalcon\Mvc\Application($di); | ||
try { | ||
$application->handle()->getContent(); | ||
} | ||
catch (Exception $e) { | ||
echo $e->getMessage(), PHP_EOL; | ||
} | ||
?> | ||
--EXPECT-- | ||
IndexController handler class cannot be loaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Ability to restrict the maximum password length for Phalcon\Security::checkHash() - https://github.com/phalcon/cphalcon/pull/1261 | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
$s = new \Phalcon\Security(); | ||
$hash = $s->hash('password', 10); | ||
echo var_export((bool)$s->checkHash('password', $hash), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 0), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 8), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 7), 0), PHP_EOL; | ||
?> | ||
--EXPECT-- | ||
true | ||
true | ||
true | ||
false |