Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • WordPress WordPress
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • WordPressWordPress
  • Issues
  • #36
Closed
Open
Created Oct 09, 2018 by eileen@eileen🎱Owner

REST API calls using json param do not work in Wordpress context --backslashes are added

There is a long discussion on this on this PR but the approach still appears to be unresolved. I have closed the PR to track through gitlab https://github.com/civicrm/civicrm-core/pull/12813


The issue:

When CiviCRM receives an API request through extern/rest.php with a json parameter, and the CMS is WordPress, an error will result.

This is because Civi bootstraps WordPress to authenticate the API user, and WordPress escapes all quotation marks in $_POST variables whether or not PHP's magic_quotes_gpc is enabled. CiviCRM is not expecting an escaped string, and JSON decoding fails due to the extra backslashes. See wp_magic_quotes() which is called by wp-settings.php during bootstrap.

Edited Mar 04, 2019 by noah
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking