Database prefix gets replaced in entries |
|||
|---|---|---|---|
| Date: | 03/12/2010 | Show-stopper?: | |
| Status: | Bug Squashed | Reporter: | silenz |
| Reported in Version: | EE 1.6.8 | Assigned To: | Not Assigned |
| Keywords: | Control Panel, Publish, | ||
| Support Thread: | |||
Details
If your database prefix differs from “exp_” and you mention “exp_” in a weblog entry, it gets replaced with your actual prefix once you save the entry.
Comment on Bug Report
| Posted by: Robin Sowell on 16 March 2010 2:37pm | |
|
|
[ Permalink ]
Taking a look- silenz. This one looks to be tricky. |
| Posted by: Robin Sowell on 17 March 2010 8:41am | |
|
|
[ Permalink ]
silenz, after bouncing ideas back and forth, it looks like this is going to be a limitation of using a custom prefix. For sure in 1.6- when 2.0 is AR across the board, it can be addressed there. The problem is- there is no way to match just the table names. What the DB class is doing is:
$sql = preg_replace("/(\W)".$this->exp_prefix."(\S+?)/", "\\1".$this->prefix."\\2", $sql);
There just isn’t a pattern that will match the table names only. Not w/out some assumptions that we know aren’t universal in the 1.6 queries. For now, it’s an ‘edge’ case where this crops up and can hopefully be handled by using an obscure prefix when a custom prefix is needed. Make sense what’s going on and the limitations to addressing it? |
| Posted by: silenz on 17 March 2010 3:16pm | |
|
|
[ Permalink ]
> The problem is- there is no way to match just the table names. Well, there would be. But I understand the convenience in only applying the regex to the finished query. > For now, it’s an ‘edge’ case where this crops up and can hopefully be Unfortunately that doesn’t help. The thing is, no matter what prefix I use I cannot publish articles that deal with EE queries without having my prefix applied to it. Which is of course confusing for the casual reader. Well, I can of course do that, It’s just that having to use exp instead of plaintext feels kinda odd. |
| Posted by: silenz on 17 March 2010 3:19pm | |
|
|
[ Permalink ]
In the last sentence exp was &# 101;&# 120;&# 112;. That said, that doesn’t work inside [ code ] - tags. Gnarf :-| |
