Skip to content

Commit

Permalink
Merge 238d2fe into c8458cb
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbé nicolas committed Oct 19, 2017
2 parents c8458cb + 238d2fe commit 77d9f99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cli/cms/data/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export function executeQuery(match, jsonPage) {
* @return {String} url | request | value | file | other
*/
export function getSourceType(str) {
if (/http:\/\/|https:\/\//.test(str)) {
if(/http:\/\/|https:\/\/|\/\/|(\?(.*)=)/.test(str)) {
return 'url'
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/cms/editor/handlebars/printInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sourceAutocomplete from './sourceAutocomplete'
import sourceOption from './sourceOption'
import {abeExtend, User} from '../../../'
import {abeExtend, User, cmsData} from '../../../'

export function getAttributes(params) {
var attributes = ''
Expand Down Expand Up @@ -52,7 +52,7 @@ export function createInputSource(attributes, inputClass, params) {
(params.autocomplete != null && params.autocomplete === 'true') ||
(params.multiple != null && params.multiple === 'multiple')
) {
if (params.sourceString.indexOf('http') === 0) lastValues = params.source
if(cmsData.sql.getSourceType(params.sourceString) === "url") lastValues = params.source
else lastValues = JSON.stringify(params.source).replace(/\'/g, '&quote;')
inputSource += '<div class="autocomplete-result-wrapper">'
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default class EditorAutocomplete {
}
}

if (dataVal.indexOf('http') === 0) {
if(/http:\/\/|https:\/\/|\/\/|(\?(.*)=)/.test(dataVal)) {
this._ajax(
{
url: `${dataVal}${val}`,
Expand Down

0 comments on commit 77d9f99

Please sign in to comment.