2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

Problem in sending CSRF token #128

Open samirreza opened 6 years ago

samirreza commented 6 years ago

we use this wrapper on ckeditor and have problem in uploading files with bad request http response from server. i search in you files and find that there is a problem in your javascript file for appending csrf token. i think in file dosamigos-ckeditor.widget.js on line 22 you should use "ckeupload" for finding anchor tag (you use capital u for upload, ckeUpload) and because of this when we upload file via editor csrf token did not sent

tonydspaniard commented 5 years ago

Hi @samirreza I have been looking into the code and it does have the following to get into the tag:

<div id="cke_dialog_tabs_109" class="cke_dialog_tabs" role="tablist"><a class="cke_dialog_tab cke_dialog_tab_selected" cke_first="" title="Información de Imagen" id="cke_info_150" href="javascript:void(0)" tabindex="-1" hidefocus="true" role="tab" style="user-select: none;">Información de Imagen</a><a class="cke_dialog_tab" cke_last="" title="Vínculo" id="cke_Link_160" href="javascript:void(0)" tabindex="-1" hidefocus="true" role="tab" style="user-select: none;">Vínculo</a>
<!-- HERE IS THE UPLOAD TAB TAG -->
<a class="cke_dialog_tab" cke_last="" title="Cargar" id="cke_Upload_167" href="javascript:void(0)" tabindex="-1" hidefocus="true" role="tab" style="user-select: none;">Cargar</a>
<!-- END UPLOAD TAB TAG -->
<a class="cke_dialog_tab" cke_last="" title="Avanzado" id="cke_advanced_192" href="javascript:void(0)" tabindex="-1" hidefocus="true" role="tab" style="user-select: none;">Avanzado</a></div>

Demo here: https://kcfinder.sunhater.com/demos/ckeditor

I am not sure that is the cause. Could it be something else?