mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
Fixes #13738: Fixed getQueryParams() method in yii.js to correctly parse URL with question mark and no query parameters
This commit is contained in:
committed by
Alexander Makarov
parent
bc59d5da85
commit
b00cd65ef3
@@ -303,6 +303,12 @@ describe('yii.gridView', function () {
|
||||
describe('with different urls', function () {
|
||||
describe('with no filter data sent', function () {
|
||||
withData({
|
||||
// https://github.com/yiisoft/yii2/issues/13738
|
||||
'question mark, no query parameters': [
|
||||
'/posts/index?',
|
||||
'/posts/index',
|
||||
'PostSearch[name]=&PostSearch[category_id]='
|
||||
],
|
||||
'query parameters': [
|
||||
'/posts/index?foo=1&bar=2',
|
||||
'/posts/index',
|
||||
|
||||
@@ -739,6 +739,8 @@ describe('yii', function () {
|
||||
describe('getQueryParams method', function () {
|
||||
withData({
|
||||
'no query parameters': ['/posts/index', {}],
|
||||
// https://github.com/yiisoft/yii2/issues/13738
|
||||
'question mark, no query parameters': ['/posts/index?', {}],
|
||||
'query parameters': ['/posts/index?foo=1&bar=2', {foo: '1', bar: '2'}],
|
||||
'query parameter with multiple values (not array)': ['/posts/index?foo=1&foo=2', {'foo': ['1', '2']}],
|
||||
'query parameter with multiple values (array)': ['/posts/index?foo[]=1&foo[]=2', {'foo[]': ['1', '2']}],
|
||||
|
||||
Reference in New Issue
Block a user