title: Custom CKEditor Oembed consumer callback is invalid in Symfony
body: <p>I am using the latest CKeditor from the CDN 4.5.4. I am trying to implement a custom Oembed consumer as described here <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-embed_provider" rel="nofollow">http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-embed_provider</a></p>
  
  <p>I am using Symfony as the endpoint retrieving the Oembed information. I reach it with a URL like this <a href="http://localhost/oembed/?url=https://www.facebook.com/someecards/posts/987699161267010&amp;callback=CKEDITOR._.jsonpCallbacks[78]" rel="nofollow">http://localhost/oembed/?url=https://www.facebook.com/someecards/posts/987699161267010&amp;callback=CKEDITOR._.jsonpCallbacks[78]</a></p>
  
  <p>The <code>url</code> and <code>callback</code> are provided for me by CKeditor and as far as I understand, the callback cannot be altered.</p>
  
  <p>I am using <a href="https://github.com/oscarotero/Embed" rel="nofollow">https://github.com/oscarotero/Embed</a> to succesfully get all sorts of links. The problem is how I choose to return the data from Symfony.</p>
  
  <p>If I choose to send the response back as a text string, everything works, but on certain embeds like facebook, they include <code>&lt;script&gt;</code> tags which are getting processed and altering the return. Ideally I would like to use the proper <code>JSONP</code> method that Symfony provides like this...</p>
  
  <pre><code>$response = new JsonResponse($this-&gt;payload, 200, array());
  $response-&gt;setCallback($callback);
  return $response;
  </code></pre>
  
  <p>However when I do this, I am told by Symfony...</p>
  
  <p><code>InvalidArgumentException in JsonResponse.php line 77: The callback name is not valid.</code></p>
  
  <p>So is <code>CKEDITOR._.jsonpCallbacks[78]</code> a valid jsonp callback? Is there anything I can do to get around this? The reason for this effort in the first place is that Iframe.ly, the default CKEditor oembed consumer, does not handle facebook embeds. Maybe for the same reason.</p>