This has worked fine for all my sites and merchants so far. However, I've had a tracking problem with one of the merchants recently (sales were not tracked at all) and they advised against using PHP redirects as that may not track properly.
I've done a server headers check on both masked and non-masked links and the affid is preserved in both cases. I can't see how it wouldn't track properly but if it's true, then I'm concerned that some of the sales may not track for ALL my other merchants with Commission Junction and other networks.
So, in your experience, could the code above cause problems? Also, could it only fail with some of the sales or is it safe to say that if it works (e.g. tracks sales), then I can expect it to be consistent?