This issue is the same as
XWIKI-2583 in the case there is more than one space in the name of the page or the space.
To reproduce it :
- create a new page with the name "My favorite pages" that has 2 spaces in its name
- edit this page with the wysiwyg editor to add a photo
- when you save, the photo has disappeared from the page.
I have found a correction to this by analyzing the correction of the JIRA 2583.
Here it is :
In attachment.js, replace the line :
by the following line :