开发者

SecurityID doesn't match, possible CSRF attack

I'm working on a site which was coded with Silverstripe, I've got a problem with importing images from the existing folders and wonder if someone can help me on this.

SecurityID doesn't match, possible CSRF attack

Here is what I'm experiencing with SS admin (please see the image attached). 1) I click on File & Images tab, then select a folder eg called Uploads 2) I choose 'Add files to Uploads' button, it will ask me to u开发者_运维知识库pload from my computer or import from an existing folder. 3) When I try to import an image from an existing folder, the message - "SecurityID doesn't match, possible CSRF attack." comes up, and I can't go any further.

I've never experienced this before, and wonder if someone can point me to the right direction to solve the problem? I can copy some code here if you let me know which part, and I'm using SilverStripe 2.4.1

Thank you very much for your help.


i've once come across this error when importing existing files in FileDataObjectManager

my fix was to add the SecurityID field the FieldSet that's returned by the getImportFields method (around line 452 in FileDataObjectManager.php):

new HiddenField('SecurityID','',Session::get('SecurityID'))


The error message is misleading. I had this error while trying to import images from a directory which did not have read permissions for the web user.

Your issue might however be something completely unrelated.


new HiddenField('SecurityID','',Session::get('SecurityID'))

does fixed for me. I am thinking it could be a older version of DOM problem, the latest version all seems alright.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜