php - Symfony: email address as request parameter -


I have some problems with passing an email address in a URL in a symphony app.

The URL looks like

  example.com/unsubscribe/email/me@example.com  

its always a SfError404Exception , apart from removing the duration, after doing some Googleing around, I have seen so far that the only solution is that the HTACS is interrupting the URL due to that time. However, when I add htaccess to correct the suggested solution, such as:

  # we will release some rewriteconds except% {REQUEST_URI} \. + $ Rewrite %% {REQUEST_URI }! @ + #skip email address rewritecand% {REQUEST_URI} \ .epl $ RewriteCond% {REQUEST_URI} !. Html $ RewriteCond% {REQUEST_URI}! \. Rhtml $ RewriteRule * - [L]  

I get the same 404. When I use Front Controller directly in the URL, it also gives 404 ( example.com/index.php/unsubscribe/email/me@example.com ). I've tried putting the escape version directly into the address bar, for example example.com/unsubscribe/me%40example%2Ecom and it works, but only in Firefox, nowhere.

I have spent about 2 hours in response to the forum at this point and I am running away from ideas.

Any thoughts?

Thank you.

P> Update: Routing here. The relevant section of the IML is:

  Cancel subscription: url: / unsubscribe / email /: email alias: {module: subscribe , Action: Index}  

Update : Stack trace ... It looks like I did not get any root information for it

  404 | Not found. After parsing the SfError404Exception URL "/unsubscribe/email/me@example.com" (/), empty module and / or verb. Stack Trace 1. SFSIfYA_LiBDIR / Controller / SFFront WebCentrolor.Class.FPP Route 44 ... 41. 42. (if empty ($ modules_name) || Free ($ ActionNum) 43. {44. The new SFERR 404 throw expiration sprintf (''% s '(% s ​​/% s)', $ request- & gt; getPathInfo (), $ modulation name, $ actionName) after parsing empty module and / or verb ;); 45.} 46. 47. // First request 2. SFFrontWebController-> Remittance () SF_simfni_libidir / ut / sfcontex. Class. PHP line 15 9 ... 156. * / 157. Public function Dispatch (158) {15.9 $ this- & gt; GetController () - & gt; Despatch (); 160.} 161. 162. / ** 3. /home/web/htdocs/index.php Line 10 ... in sfContext-> Sending (). 7. need_once (SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR 'ProjectConfiguration. Class.php '); 8. 9. $ Configuration = Project Configuration :: Received Application Configuration (SF_APP, SF_Environment, SF_DebUs); 10. sfContext :: createInstance ($ configuration) - & gt; Despatch ();  

11

By default, symphony . As the and / parameter separator.
It's easy to match the URL:

  / some / path /: param  

But the email address does not help.

Fortunately, you can override the . Separator by specifying your own patterns.
Just add Requirements below for your routing:

  Unsubscribe: url: / unsubscribe / email /: Email: Ultimate: {module: subscribe, Take Action: Index} Requirements: {email:. +}  

. There is a regular expression in the requirement that matches anything. . matches any character, and matches + one or more.

(tested in Symfony 1.4)


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -