10000 fix: do not convert & URL query separator to & · django-cms/django-cms@f470461 · GitHub
[go: up one dir, main page]

Skip to content

Commit f470461

Browse files
committed
fix: do not convert & URL query separator to &
1 parent 38aa11c commit f470461

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

cms/static/cms/js/dist/3.9.0/bundle.admin.base.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cms/static/cms/js/dist/3.9.0/bundle.toolbar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cms/static/cms/js/modules/cms.base.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,7 @@ export const Helpers = {
340340
newUrl.addSearch(key, value);
341341
});
342342

343-
return newUrl
344-
.toString()
345-
.split('#')
346-
.map((part, i) => {
347-
return i === 0 ? part.replace(/&/g, '&') : part;
348-
})
349-
.join('#');
343+
return newUrl.toString();
350344
},
351345

352346
/**

cms/tests/frontend/unit/cms.base.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -769,45 +769,45 @@ describe('cms.base.js', function() {
769769
var url;
770770

771771
url = CMS.API.Helpers.makeURL('test', [['param', '1'], ['another', '2']]);
772-
expect(url).toEqual('test?param=1&another=2');
772+
expect(url).toEqual('test?param=1&another=2');
773773

774774
url = CMS.API.Helpers.makeURL('test?param=1', [['another', '2']]);
775-
expect(url).toEqual('test?param=1&another=2');
775+
expect(url).toEqual('test?param=1&another=2');
776776

777777
url = CMS.API.Helpers.makeURL('test?param=1&another=2', [['different', '3']]);
778-
expect(url).toEqual('test?param=1&another=2&different=3');
778+
expect(url).toEqual('test?param=1&another=2&different=3');
779779

780780
url = CMS.API.Helpers.makeURL('test?param=1&another=2', [['different', '3']]);
781-
expect(url).toEqual('test?param=1&another=2&different=3');
781+
expect(url).toEqual('test?param=1&another=2&different=3');
782782

783783
url = CMS.API.Helpers.makeURL('test?param=1&another=2&again=3', [['different', '3']]);
784-
expect(url).toEqual('test?param=1&another=2&again=3&different=3');
784+
expect(url).toEqual('test?param=1&another=2&again=3&different=3');
785785
});
786786

787787
it('replaces param values with new ones if they match', function() {
788788
var url;
789789

790790
url = CMS.API.Helpers.makeURL('test?param=1&another=2', [['another', '3']]);
791-
expect(url).toEqual('test?param=1&another=3');
791+
expect(url).toEqual('test?param=1&another=3');
792792

793793
url = CMS.API.Helpers.makeURL('test?param=1&another=2', [['another', '3'], ['param', '4']]);
794-
expect(url).toEqual('test?another=3&param=4');
794+
expect(url).toEqual('test?another=3&param=4');
795795
});
796796

797797
it('understands hashes in the url', function() {
798798
var url;
799799

800800
url = CMS.API.Helpers.makeURL('test#hash', [['param', '1'], ['another', '2']]);
801-
expect(url).toEqual('test?param=1&another=2#hash');
801+
expect(url).toEqual('test?param=1&another=2#hash');
802802

803803
url = CMS.API.Helpers.makeURL('test#hash#with#hash', [['param', '1'], ['another', '2']]);
804-
expect(url).toEqual('test?param=1&another=2#hash#with#hash');
804+
expect(url).toEqual('test?param=1&another=2#hash#with#hash');
805805

806806
url = CMS.API.Helpers.makeURL('test#', [['param', '1'], ['another', '2']]);
807-
expect(url).toEqual('test?param=1&another=2');
807+
expect(url).toEqual('test?param=1&another=2');
808808

809809
url = CMS.API.Helpers.makeURL('test#hash&stuff', [['param', '1'], ['another', '2']]);
810-
expect(url).toEqual('test?param=1&another=2#hash&stuff');
810+
expect(url).toEqual('test?param=1&another=2#hash&stuff');
811811

812812
url = CMS.API.Helpers.makeURL('test#hash&stuff', []);
813813
expect(url).toEqual('test#hash&stuff');

cms/tests/frontend/unit/cms.structureboard.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ describe('CMS.StructureBoard', function() {
21182118

21192119
expect($.ajax).toHaveBeenCalledWith({
21202120
url: jasmine.stringMatching(
2121-
/TOOLBAR_URL\?obj_id=100&obj_type=cms.page&cms_path=%2Fcontext.html.*/
2121+
/TOOLBAR_URL\?obj_id=100&obj_type=cms.page&cms_path=%2Fcontext.html.*/
21222122
)
21232123
});
21242124
});

0 commit comments

Comments
 (0)
0