I may be taking crazy pills, but it seems like SFDC is doing a find and replace on any strings with a production org id and replacing them with the sandbox org id when creating a sandbox. I can't seem to find this behavior documented anywhere. Has anyone else seen this?
I have a class
Org_Constants which has a constant for the production org id, so I can have code behave differently in production and sandbox environments. But it never works in new sandboxes, since it ends up with the sandbox id listed for the production org id.