signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

Support Ubuntu 16.04 w/PHP 7 #61

Open signalpoint opened 7 years ago

signalpoint commented 7 years ago

Reported by Charles Sheinin and Greg Hoch at mentor.com :

After migrating to Ubuntu 16.04 w/PHP 7, we noticed that there was some whitespace being added to the start of the CSRF token, resulting in breaking stuff. I’m not sure what exactly changed, but here’s what fixes it (-p1 diff):

*************** Drupal.services.call = function(options)
*** 1750,1751 ****
--- 1750,1752 ----
              if (token) {
+               token = $.trim(token);
                request.setRequestHeader('X-CSRF-Token', token);

Please let us know if you push out a new version with this changed.