Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data with apostrophe, quotes etc. blocking the setList() to display data #70

Open
mayeenulislam opened this issue Oct 3, 2017 · 0 comments

Comments

@mayeenulislam
Copy link

How to reproduce

  • Input data into a text field in repeater like: Someone's name (the data has single quote/apostrophe)
  • Store the data into database
  • When building the data for setList() pass the raw data from db
  • The json_encode()-ed data won't fill the repeater fields with data

Expected Bahivour

The data should populate the repeaters as the array contains.

Taken measure

Seeing the anomaly, while building the data, we imposed:
htmlspecialchars($value['username'], ENT_QUOTES, 'UTF-8');

Now the data is displaying from the array. But, the HTML special characters are there:
Someone's Name

💯 NEED A FIX FOR QUOTED DATA ON UPCOMING RELEASE

Temporary measure

We've taken the method from this answer:
https://stackoverflow.com/a/1395954/1743124

And within the foreach loop on line 106, we've unEscaped the data before populating the fields:

foreach(collection, function (val, key, coll) {
	val = decodeEntities(val); // <-------- unEscaping the string
	if(callback(val, key, coll)) {
	      filtered[key] = val;
	}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant