-
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.
CollectionView: Prevent URL escaping when listing pagination URLs (#154)
* Prevent URL escaping when listing pagination URLs * Fix warnings / errors in pipeline
- Loading branch information
1 parent
e56742b
commit 25e980d
Showing
5 changed files
with
37 additions
and
2 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
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
<?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. | ||
* | ||
* @param array<string, mixed> $options Pagination options. | ||
* @param array $url URL. | ||
* @param array<string, mixed> $urlOptions Array of options | ||
* @return string By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript) | ||
*/ | ||
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