-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent URL escaping when listing pagination URLs
- Loading branch information
1 parent
e56742b
commit 20b9f3c
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
plugins/collection-view/src/View/Helper/PagninatorHelper.php
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,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace MixerApi\CollectionView\View\Helper; | ||
|
||
use Cake\View\Helper\PaginatorHelper; | ||
|
||
class PagninatorHelper extends PaginatorHelper | ||
{ | ||
/** | ||
* Overwrite base method to never escape URLs. | ||
* | ||
* @inheritdoc | ||
*/ | ||
public function generateUrl( | ||
array $options = [], | ||
array $url = [], | ||
array $urlOptions = [] | ||
): string { | ||
$urlOptions += [ | ||
'escape' => false, | ||
'fullBase' => false, | ||
]; | ||
|
||
return $this->Url->build($this->generateUrlParams($options, $url), $urlOptions); | ||
} | ||
} |
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