Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust config.example.php for better international area code conversion #49

Open
wants to merge 174 commits into
base: master
Choose a base branch
from

Conversation

obnys
Copy link

@obnys obnys commented Jan 20, 2020

Currently the international area code '+49' is beeing replaced with nothing '' by default at the config.example.php:

...
'+49' => '',  // router is usually operated in 'DE; '0049' could also be part of a phone number
...

I'd suggest to replace this entry with the following lines in order to keep the phone number intact by default. Otherwise the area code of the phone number would miss the leading '0'

...
'+49'  => '0',
'0049'  => '0',
'+'     => '00',    // keep international area codes for foreign countries intact.
...

As for non-german users (no idea, how big the user community is), it might be even better to define the local international area code in some kind of a variable at the top of the config.example.php. If this entry stays empty, the program could assume let's say for example Germany for the local international area code. I have no idea about that program language, but in Linux style, it might look like this:

...
OWNCOUNTRY='49' // empty by default
[ $OWNCOUNTRY = '' ] && { // when empty, set to 49
   OWNCOUNTRY='49'
}
...
// And at the part for replacing the characters:
...
"+\$OWNCOUNTRY"  => '0', // pls note the double quote becouse of the variable
"00\$OWNCOUNTRY"  => '0', // pls note the double quote becouse of the variable
'+'     => '00',    // keep international area codes for foreign countries intact.
...

BUT: What I'm not sure about is how to prevent the config from replacing the number, let's say 0049, in the middle of a number like 012334 / 90049123454. Would it be possible to inspect the beginning of a string? Like in Linux you would use

// in case of +49
[ $(echo $PHONENUMBER | cut -c 1-3) == "+$OWNCOUNTRY" ] && { 
   $PHONENUMBER = 0$(echo $PHONENUMER | cut -c 3-)  // add a 0 in front and remove first 3 digits
}
// in case of 0049
[ $(echo $PHONENUMBER | cut -c 1-4) == "00$OWNCOUNTRY" ] && { 
   $PHONENUMBER = 0$(echo $PHONENUMER | cut -c 4-)  // add a 0 in front and remove first 3 digits
}

@obnys obnys closed this Jan 20, 2020
@obnys obnys reopened this Jan 20, 2020
blacksenator and others added 26 commits February 11, 2020 08:49
* replace redundant login code with function
* split exportPhonebook in conversion to contacts and XML phonebook assembly
Updates the requirements on [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) to permit the latest version.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md)
- [Commits](guzzle/guzzle@6.0.0...7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Fixing VIP attribute examples in config.example.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet