Closed fritzmg closed 6 years ago
@fritzmg The PR should be targeted against the 4.4 branch, shouldn't it?
Hm, true, I mis-targeted because I have done this for a new feature (#1507).
I forcefully changed the base now... not sure if that was a good idea ;)
Wouldn't a simple strip_tags()
do the job, too?
Well, the ResponseException
is thrown in DC_Folder
, however there I have no information about whether the response is for the DropZone or not. Unless we can assume that any AJAX Request wants the messages from the response in pure text instead of HTML?
Unless we can assume that any AJAX Request wants the messages from the response in pure text instead of HTML?
I guess we can safely assume this. 😉
Ok :). Then I guess
elseif ($blnIsAjax)
{
throw new ResponseException(new Response(\strip_tags(\Message::generateUnwrapped()), 500));
}
is sufficient.
You don't need to prefix the strip_tags()
function. It cannot be optimized by the OPcache.
PR updated.
@leofeyer this needs to be merged too - otherwise #1507 won't work properly :)
Since you did not like the strip_tags()
approach, I have implemented something else in 8c99c38fdd5b435037ee546b26abe6f4fefd916d. Do you like it?
Looks good! This way "raw" error messages can be used somewhere else too.
I have backported the changes in a53201e0cbd96c177495b92fca298a4b75154ded.
This fixes #1506. Not the most elegant solution though. Fix is needed for #1507.