2017-11-13 7 views
0

최근에 우리는 PHP 5.3에서 PHP 7로 서버를 업데이트했습니다. 실제로 업데이트로 인해이 문제가 발생하는지는 모르겠지만 파일을 삽입 할 때filemanager 플러그인 - TinyMCE - 서버 응답이 JSON 형식이 아니 었습니다

서버 응답

JSON 형식

아니었다 나는 그것에 대해 인터넷에서 아무것도 발견하지 않았습니다 : TinyMCE에의 javascirpt 나는이 오류 메시지가 나타납니다. 여기

는 Json_data입니다 :

{"method":"fm.insertFiles","params":[{"path0":"{0}/Sage.JPG"}],"id":"c0"} 

여기 TinyMCE에 구성은 다음과 같습니다

tinyMCE.init({ 
    // General options 
     mode : "exact", 
     elements : "msg_body", 
    theme : "advanced", 
    theme_advanced_resizing_max_width : 530, 
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,spellchecker,filemanager", 

    // Theme options 
    theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,|,styleselect,formatselect,|,forecolor,backcolor,<?if ($staff[perm][msg_replies]==1) {?>|,insertfile,link,<?}?>|,spellchecker", 
    theme_advanced_buttons2 : "", 
    theme_advanced_buttons3 : "", 
    theme_advanced_buttons4 : "", 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_statusbar_location : "bottom", 
    theme_advanced_resizing : true, 

    //External 
    extended_valid_elements : "iframe[src|width|height|name|align]", 

    // Example content CSS (should be your site CSS) 
    content_css : "../style-bijou.css", 

    // Drop lists for link/image/media/template dialogs 
    template_external_list_url : "lists/template_list.js", 
    external_link_list_url : "lists/link_list.js", 
    external_image_list_url : "cms-image_list.php", 
    media_external_list_url : "lists/media_list.js", 

    // Style formats 
    style_formats : [ 
     {title : 'Bijou Weddings styles'}, 
     {title : 'Bijou copy', block : 'p', classes : 'copy'}, 
     {title : 'Bijou copy bold', inline : 'span', classes : 'title'}, 
     {title : 'Corporate Event styles'}, 
     {title : 'Event bullets small', block : 'p', classes : 'corpbodybull'}, 
     {title : 'Event bullets big', block : 'p', classes : 'corpbull'}, 
     {title : 'Table styles'}, 
     {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} 
    ], 

    // Replace values for the template plugin 
    template_replace_values : { 
     username : "Some User", 
     staffid : "991234" 
    } 

}); 

당신이 어떤 생각을하시기 바랍니다해야합니까? 감사

+0

정말 여기

는 php.net의 설명이다? 아무것도 못 찾았 니? JSON을 공유해 주시겠습니까? – evolutionxbox

+0

그 메시지 오류가 플러그인 "filemanager"에 의해 생성되는 경우, 그 메시지 오류와 관련하여 TinyMCE에 대한 해당 "파일 관리자"와 관련된 내용을 찾지 못했습니다 –

+0

json_data가 없습니다 : 해당 코드는 TinyMCE 플러그인에 의해 생성됩니다. –

답변

2

json_data의와 응답을 보낼 수있는,

플러그인 "파일 관리자"PHP는 오류있는 파일 History.php을 생성 폴더 /plugins/filemanager/plugins/History에서 split이라는 php 함수가 사용 중이며 php7에서는 더 이상 사용되지 않습니다.

그래서 split 함수를 explode으로 바꿉니다. 이제 파일 삽입이 제대로 작동합니다.

희망이 유용 할 것입니다. http://php.net/manual/en/function.split.phphttp://php.net/manual/en/function.explode.php

+0

게시 해 주셔서 감사합니다. 나는 똑같은 문제를 가지고 있었고 귀하의 솔루션으로 인해 수 시간의 문제 해결 시간을 절약 할 수있었습니다. – vertigoelectric

+0

당신은 환영합니다, 그것은 서로를 돕는 몫 장소를 갖는 아이디어입니다. 방법으로 PHP 오류 로그에 액세스 할 수 없으면 해결할 수 없습니다. –

0

시도 마침내 문제를 발견

$data = {"method":"fm.insertFiles","params":[{"path0":"{0}/Sage.JPG"}],"id":"c0"}; json_encode($data);

intead

+0

안녕하세요 마르코, json 데이터가 플러그인에 의해 생성되므로 TinyMCE 자바 스크립트 플러그인의 오류입니다. javascipt를 통해 TinyMCE를 관리하고 json 호출을 직접 보내지 않습니다. 죄송합니다. 자신을 밝힐 수없는 경우 –

+0

선택기를 컨테이너로 사용하여 응답을 보내고 있습니까? '요소들 : msg_body ",'? – marcoprograma

+0

"msg_body"는 CSS 클래스이고, "mgs_body"클래스는 HTML 텍스트 영역에 할당되고, 자바 스크립트는 텍스트 영역에 대해 TinyMCE 플러그인을로드합니다. 이것은 TinyMCE의 작동 방식입니다. –