Upgrade and ...... retrieve_conf blues

Hi all,
I’m a not so “new” member with some specific experience in different field but really new with freepbx and all the behaviour of pbx open source.

The question is this … there is a better way to fix an upgraded freepbx installation (specifically an elastix installation but … I’ve seen the same problem more than one forum) ?

The file retrieve_conf present a specific problem and issue, related to the “environment” or … something in the default environment.

I’ve fixed this file file using a trick, with a substitution for each row where is used the variable:

$amp_conf[‘ASTETCDIR’] = str_replace("\r", ‘’, $amp_conf[‘ASTETCDIR’]);

I know that this is a trick, and I know that there is many files with the same problem, so … any suggestion ?

thank you very much