You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 19, 2020. It is now read-only.
When updating a custom field, an error occurs which says
Whoops!
Something wrong happened.
I checked the code for editing a custom field and found where the problem was.
The code is located at: \anchor\routes\fields.php on lines 135-137.
foreach($input as $key => &$value) {
$value = eq($value);
}
It seems to be missing an if statement that can be found in the same identical code on lines 44-50 , for adding custom fields.
// an array of items that we shouldn't encode - they're no XSS threat
$dont_encode = array('attributes');
foreach($input as $key => &$value) {
if(in_array($key, $dont_encode)) continue;
$value = eq($value);
}
The if statement basically excludes the attributes index because it is an Array. Because this statement is missing for the editing of custom fields (lines 135-137), the attributes array gets passed onto the eq() method. This method just calls htmlspecialchars(), which only accepts a string value for its 1st parameter.
Now for the solution, I just copied the code found on lines 44-50 and replaced the code found on lines 135-137.
Anchor version: 0.12.1
The text was updated successfully, but these errors were encountered:
When updating a custom field, an error occurs which says
I checked the code for editing a custom field and found where the problem was.
The code is located at:
\anchor\routes\fields.php
onlines 135-137
.It seems to be missing an
if
statement that can be found in the same identical code onlines 44-50
, for adding custom fields.The
if
statement basically excludes theattributes
index because it is anArray
. Because this statement is missing for the editing of custom fields (lines 135-137
), theattributes
array gets passed onto theeq()
method. This method just callshtmlspecialchars()
, which only accepts astring
value for its 1st parameter.Now for the solution, I just copied the code found on
lines 44-50
and replaced the code found onlines 135-137
.The text was updated successfully, but these errors were encountered: