Skip to content
6 changes: 3 additions & 3 deletions documentation/html/classes.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h4 id="buildFacets"><span class="type-signature">&lt;constant> </span>buildFace
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-192">line 192</a>
<a href="store_recordSearch.js.html#sunlight-1-line-199">line 199</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -538,7 +538,7 @@ <h4 id="paramsAreExpired"><span class="type-signature">&lt;constant> </span>para
<ul class="dummy">
<li>
<a href="store_introspector.js.html">store/introspector.js</a>,
<a href="store_introspector.js.html#sunlight-1-line-154">line 154</a>
<a href="store_introspector.js.html#sunlight-1-line-153">line 153</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -771,7 +771,7 @@ <h5>Type:</h5>
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-167">line 167</a>
<a href="store_recordSearch.js.html#sunlight-1-line-174">line 174</a>
</li>
</ul>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions documentation/html/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ <h4 id="buildFacets"><span class="type-signature">&lt;constant> </span>buildFace
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-192">line 192</a>
<a href="store_recordSearch.js.html#sunlight-1-line-199">line 199</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -518,7 +518,7 @@ <h4 id="paramsAreExpired"><span class="type-signature">&lt;constant> </span>para
<ul class="dummy">
<li>
<a href="store_introspector.js.html">store/introspector.js</a>,
<a href="store_introspector.js.html#sunlight-1-line-154">line 154</a>
<a href="store_introspector.js.html#sunlight-1-line-153">line 153</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -751,7 +751,7 @@ <h5>Type:</h5>
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-167">line 167</a>
<a href="store_recordSearch.js.html#sunlight-1-line-174">line 174</a>
</li>
</ul>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions documentation/html/modules.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h4 id="buildFacets"><span class="type-signature">&lt;constant> </span>buildFace
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-192">line 192</a>
<a href="store_recordSearch.js.html#sunlight-1-line-199">line 199</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -538,7 +538,7 @@ <h4 id="paramsAreExpired"><span class="type-signature">&lt;constant> </span>para
<ul class="dummy">
<li>
<a href="store_introspector.js.html">store/introspector.js</a>,
<a href="store_introspector.js.html#sunlight-1-line-154">line 154</a>
<a href="store_introspector.js.html#sunlight-1-line-153">line 153</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -771,7 +771,7 @@ <h5>Type:</h5>
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-167">line 167</a>
<a href="store_recordSearch.js.html#sunlight-1-line-174">line 174</a>
</li>
</ul>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions documentation/html/namespaces.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h4 id="buildFacets"><span class="type-signature">&lt;constant> </span>buildFace
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-192">line 192</a>
<a href="store_recordSearch.js.html#sunlight-1-line-199">line 199</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -538,7 +538,7 @@ <h4 id="paramsAreExpired"><span class="type-signature">&lt;constant> </span>para
<ul class="dummy">
<li>
<a href="store_introspector.js.html">store/introspector.js</a>,
<a href="store_introspector.js.html#sunlight-1-line-154">line 154</a>
<a href="store_introspector.js.html#sunlight-1-line-153">line 153</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -771,7 +771,7 @@ <h5>Type:</h5>
<ul class="dummy">
<li>
<a href="store_recordSearch.js.html">store/recordSearch.js</a>,
<a href="store_recordSearch.js.html#sunlight-1-line-167">line 167</a>
<a href="store_recordSearch.js.html#sunlight-1-line-174">line 174</a>
</li>
</ul>
</dd>
Expand Down
2 changes: 1 addition & 1 deletion documentation/html/quicksearch.html

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions documentation/html/store_introspector.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,11 @@ <h1 class="page-title">Source: store/introspector.js</h1>
const parseParam = function (param, paramVal) {
if (param.name === "Int") {
return parseFloat(paramVal)

}
else if (param.name === "Boolean") {
return JSON.parse(paramVal)
}
return paramVal
return paramVal;
};

/**
Expand Down
9 changes: 8 additions & 1 deletion documentation/html/store_recordSearch.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,15 @@ <h1 class="page-title">Source: store/recordSearch.js</h1>
this.commit("records/setLoadingStatus", true);
this.commit("records/resetRecords");
this.commit("records/resetPages");
// params['q'] needs to be sanitised here.
if (Object.keys(params).length > 0) {
// attempt to fix single fields with brackets, as per:
// https://github.com/FAIRsharing/fairsharing.github.io/issues/2648
Object.keys(params).forEach((key) => {
if (String(params[key]).includes('(') || String(params[key]).includes(')')) {
params[key] = [params[key]];
}
})
// params['q'] needs to be sanitised here.
if ("q" in params) {
// TODO: Is it worth preserving foreign characters as discussed here?
// https://stackoverflow.com/questions/22192458/how-to-remove-non-alphanumeric-characters-and-space-but-keep-foreign-language-i
Expand Down
3 changes: 1 addition & 2 deletions src/store/introspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ export default introspectionStore;
const parseParam = function (param, paramVal) {
if (param.name === "Int") {
return parseFloat(paramVal)

}
else if (param.name === "Boolean") {
return JSON.parse(paramVal)
}
return paramVal
return paramVal;
};

/**
Expand Down
9 changes: 8 additions & 1 deletion src/store/recordSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ export const actions = {
this.commit("records/setLoadingStatus", true);
this.commit("records/resetRecords");
this.commit("records/resetPages");
// params['q'] needs to be sanitised here.
if (Object.keys(params).length > 0) {
// attempt to fix single fields with brackets, as per:
// https://github.com/FAIRsharing/fairsharing.github.io/issues/2648
Object.keys(params).forEach((key) => {
if (String(params[key]).includes('(') || String(params[key]).includes(')')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible could you please try params[key] = [params[key]], instead of creating an array variable and pushing and assigning

params[key] = [params[key]];
}
})
// params['q'] needs to be sanitised here.
if ("q" in params) {
// TODO: Is it worth preserving foreign characters as discussed here?
// https://stackoverflow.com/questions/22192458/how-to-remove-non-alphanumeric-characters-and-space-but-keep-foreign-language-i
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/store/records.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('Mutation & Actions & Getters', () => {
const options = {
params: {
fairsharingRegistry: "Standard",
isRecommended: true
isRecommended: true,
organisations: "european union (eu)"
},
token: 'abc123'
};
Expand Down