Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 4.7.1
-
Fix Version/s: Unscheduled
-
Component/s: WordPress Integration
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
The REST API inserts apostrophes in places.
If I run this script:
$options = array('query' => array( 'key'=> API_SITE_KEY, 'api_key'=>API_USER_KEY, 'json' => 2, 'entity'=>'contact', 'action'=>'create', 'email'=>'TEST1@EXAMPLE.org', 'first_name'=>'Test', 'last_name'=>'O\'Neil', 'contact_type'=>'Individual', )); $res = $client->post(API_URL, $options);
That's PHP Guzzle lib V5.3 BTW.
I get: Test O\'Neil
If I edit /wp-content/plugins/civicrm/civicrm/extern/rest.php and add at the top:
<?php var_dump($_POST); var_dump($_GET); die();
I see:
["first_name"]=> string(4) "Test" ["last_name"]=> string(6) "O'Neil"
So it's not Guzzle adding the slash, it's CiviCRM or WordPress.
On Wordpress 4.4.2, seen on Debian Stable server.