Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check and fix possible error when doing json_encode #809

Closed
wants to merge 1 commit into from

Conversation

jyrkiput
Copy link
Contributor

json_encode can fail silently, and only way to determine
this is to check json_last_error(). One of the cases is UTF-8
error, which then can be resolved.

Implementation was found from http://stackoverflow.com/a/26760943/1682014

json_encode can fail silently, and only way to determine
this is to check json_last_error(). One of the cases is UTF-8
error, which then can be resolved.

Implementation was found from http://stackoverflow.com/a/26760943/1682014
@remdex remdex closed this in 8046bd8 Dec 24, 2015
jimurl pushed a commit to Frontline-Processing/livehelperchat that referenced this pull request Oct 20, 2016
* Change chat settings templates

* Changes LiveHelperChat#800 LiveHelperChat#810 LiveHelperChat#803 LiveHelperChat#796

* Update changelog

* fix LiveHelperChat#809

* Show user name and surname instead of first name only

* Option to filter users by username, name, surname and e-mail

* Transfer workflow improvements

* Updates UX

* fix LiveHelperChat#797

* fix LiveHelperChat#797

* Invitation support

* Enhancements 2.41v

* Update field type

* Refix LiveHelperChat#800

* More strict check

* Part 1 product

* Product part - 2

* Update user part

* Product update

* Update translations

* Missing config on install

* fix LiveHelperChat#789

* update changelog

* Encryption support

* Update translations

* Product concept for chat

* Extensions by siteaccess

* fix LiveHelperChat#802

* Tweak options for extensions

* Custom account overrides

* Missing table definition

* Use error_log to log possible database connection errors

Now possible connection errors are visible in apache/fpm/nginx logs.

* Added class to button for theming

Added "closebutton" class to this button to enable theming

* Improvements

* 2.43v

* Update translations

* Update default translation

* Show products

* Use real operator name for chat export

* Option to sort pending chats

* Increase hardcoded limit of 10 000 to 100 000 when exporting chats

10 000 is too low.

* Do not handle bbcode or url

Do not make links clickable or handle bbcode
due vulnerabilities.

* Use persistent connection for redis

No need to open completely new connection for
every request.

* Use proper comparison operator

* Replace UTF-8 "times" with escaped string

UTF-8 is not supported in all of the sites where the widget
can be embedded, so the "times" symbol is not displayed properly.

* Enable back bbcode

* Auto responder support on keu up

* Statistics template changes

* Survey classes css

* UX fixes

* Added a ';' and newlines at the end of each file (cosmetic - makes it easier
to run them manually)

* Made the Close Dialog button close the tab - use the same method as the X in
the corner

* horizontal menu on small screen size

* horizontal menu on small screen size (separate lines)

* Rest API initial version

* Cleanup

* Update translations

* Add EventEmitter

* Removes any existing chat transfer that is underway before starting a new
transfer. This avoids the issue with duplicate transfer records

* bugfix

* Update login page: add opportunity use custom login site access

* Prefill message by direct argument

* Wrap lines

* Allow override default url

* Update user login page add dispatch

* Archived chats datbase update and keep passwords while editing accounts

* Updates

* Admin themes support

* Update translations

* 0 as default admin theme

* Update structure.json

* Correct check

* Correct dispatch event

* Update version

* replacing user_green_chat.png with google compressed version

* 2.46v

* Use proactive invitation if it was used initiall

* add some multiinclude templates

* add comments in multiinclude templates

* Replaced insert to cell with variables to speed up loop

* fix LiveHelperChat#876

* Start structure automated installation from cli

* Automated installation from command line

TODO: Validate if the folder cache or var has group/user www-data at step1.

* issue LiveHelperChat#717 Automated installation script

* Remove copyright.

* LiveHelperChat#876 Changing Out staff is to Our staff are

* Update translations

* Proper validation

* Add cache

* PhpStorm config folder added to gitignore

* undefined index fix in lhchatvalidator

* chat.chat_started rewrited to chat.before_chat_started

* undefined index fix in lhchatvalidator

* tarasferuser.php updated

* tarasferuser.php ix

* chat screenshot event fix

* chat screenshot event fix

* even rename

* new canned msg create billing event fix

* chat.before_offline_request event dispachers removed, using just chat.before_chat_started

* startchatwithoperator billing event fix

* removed event dispachers returned

* uploadfile.php and uploadfileadmin.php added new event_before dispacher, and error alert addet to lh.js

* reference fix

* lhfile/new added event_before dispach

* lhfile/new set tpl var for undefined variable notice in lhfile/new.tpl.php

* lhchat/addoperation event_before update, lh.js addRemoteCommand added erros alert

* lhchatbox/chatwidget added before chat created event dispacher, added error display to chatboxwidget template

* lhfaq/faqwidget added faq.before_filled_by_user event dispacher, and undefined index fix in faqwidget template

* lhfaq/new added faq.before_created event dispacher

* lhtranslation/starttranslation translate.before_messagetranslated event dispacher added

* lib/models/lhchat/erlhcoreclassmodelchatonlineuser onlineuser.before_proactive_triggered event dispacher added

* modules/lhquestionary/votingwidget questionaire.before_feedback_left event dispacher added

* modules/lhquestionary/votingwidget questionaire.before_option_chosen event dispacher added

* reference fix

* modules/lhchat/startchat chat.before_auto_responder_triggered event dispacher added

* modules/lhchat/syncuser chat.before_auto_responder_triggered event dispacher added

* modules/lhchat/chatwidget chat.before_auto_responder_triggered event dispacher added

* modules/lhchat/lhchatworkflow xml.before_send_xmp_message event dispacher added

* design/defaulttheme/tpl/lhchat/modifychat fixed js variable name

* Fix space

* Fix

* Add space support

* Updating Google maps to use new api endpoint and, if maps_api_key is found in site settings it will append the api key to the url

* Full height option added for chat widget

* added some dispachers, and lh.js funcions for chat editing

* fast fix

* issue LiveHelperChat#836 fix

* dispachers added: abstract.before_created.*, form.on_form_render

* dispacher speech.before_getchatdialect added

* dispacher survey.validate added

* added cobrowse.before_check_mirror_changes dispacher and lh_operator.js update for error reporting

* error reporting fix for file attachments

* autoresponder error reporting update

* added translate.after_bing_translate and translate.after_google_translate event dispacher, fix on start translation exception clear chat locale vars

* autoresponder error message fix

* file.storescreenshot.before_store event dispacher added, on errors operator see it

* compile fix

* storescreenshot fix

* offline param added to chat.before_chat_started dispacher

* added chat.sync_back_office dispacher for nodejshelper notify

* offline parameter fix for dispacher

* Downgrade php version

* downgrade php version

* cobrowser update

* cobrowse.before_check_mirror_changes dispacher removed, added cobrowse.before_store_node_map for better cobrowse error handling

* added missed offline param to dispacher in chatwidget

* added error reporting for saveremarks.php and dispacher chat.before_save_remarks

* onlineuser.before_store_chat dispacher added

* onlineuser.before_proactive_triggered dispacher update

* onlineuser.before_store_chat update

* chat.before_send && chat.before_print dispachers added

* cobrowser added option for disabling operators form input, and do some separation for operators co-browse window in templates

* added external_request parameter for login form working with ajax

* login external_request update

* added dispacher for access array generation

* before_store_chat dispatcher update

* do not show active/pending/unread panels in dashboard if user not have lhchat:use permission

* break addmsgadmin if chat msg readonly

* Add back support shift+enter

* material icons font files update to newer version

* jquery.hotkeys update

* fix LiveHelperChat#895

* fix LiveHelperChat#893

* chat widget full height implementation update

* fix LiveHelperChat#865
Implemented correct workflow for new google maps API

* Preparation for new PHP version

* chatwidget fix

* fix LiveHelperChat#848

* fix LiveHelperChat#854
Looks like it's a chrome bug just. I could not apply 0 height, because it makes restoring position of widget incorrect

* full height update for chat reopen

* option makeLInksClickable for disable/enable it with dispatcher chat.before_make_clickable

* added after_cannedmsgform_multiinclude template

* REST API to set operator online/offline status

* Example how to user rest API offline/online operator status

* Dispatch then operator status changes

* small bugfixes

* 2.47v

* Override options

* msg fields changed from text to longtext for tables lh_chat and lh_canned_msg

* Execute remote command on chat close

* before_iframe_container template added for user widget

* added chat.chat and chat.chatwidgetchat dispatchers and update some other

* before_iframe_container fix

* widget fullheight update

* messages vertical aligin bottom, for full height

* added after/before tempaltes for userchat pagelayout

* added reference

* changed after_userchat position

* added result reference to chat.chat dispatcher

* added before/after widget content templates

* changes before/after user chat template locations

* added result reference to chat.chatwidgetchat dispatcher

* added result reference to chat.chatwidget dispatcher

* Chat embed code fixes

* full height updated to proactive messages

* vid added to offline form action

* added new  multiinclude template for lhchat/getstatus template

* XMP fix for PHP7

* hattr option for offline_form update

* editnick fix, for left debug echo

* onlineuser.handle_request dispatcher added

* pagelayout userchat before and after content includes

* Tag support for proactive invitation

* Update changelog for 2.48v

* REST API to change visibility

* 2.49v

* Rename

* Drop field if new field already exists

* Reorder

* Inform chat workflow

* Update SQL

* Option to prefill username, email, phone via JS

* Survey improvements

* fix install sql

* Survey item

* fix LiveHelperChat#923

* Abort fix..

* adjust display only in online visitors list

* event for widget form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant