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

Compatibility issue with non-standard arg separator #3116

Closed
CaMer0n opened this issue May 5, 2018 · 1 comment
Closed

Compatibility issue with non-standard arg separator #3116

CaMer0n opened this issue May 5, 2018 · 1 comment
Labels
type: bug A problem that should not be happening type: enhancement An improvement or new feature request
Milestone

Comments

@CaMer0n
Copy link
Member

CaMer0n commented May 5, 2018

The following legacy code (dating back to e107 v1) on line 3791 of e107_class.php has compatibility issues with third-party scripts:

self::ini_set('arg_separator.output',     '&');

This "non-standard" setting influences how http_build_query behaves and may cause problems for third-party libraries when they expect the default query parameter to be & because they want to execute a curl request for example.

Throughout the core this value is very often overridden, such as this example on Line 1513 of install.php:

$base = base64_encode(http_build_query($data, null, '&')); 

In many cases class2.php will simply be included prior to the third-party script in order to load user data or prefs. In such a case these scripts may throw errors due to this setting. e107 is not alone in this scenario as you can see here: owncloud/core#14782

For this reason, I'm going to disable this line, reverting to its default '&' value.

If developers require an & (such as when building links for html) then please set it manually as per the following example:

 http_build_query($data, null, '&'); 

I'll be doing the same in the core where it is necessary.
If anyone else finds an issue with this change, please do comment below.

Many Thanks.

@CaMer0n CaMer0n added type: bug A problem that should not be happening type: enhancement An improvement or new feature request labels May 5, 2018
@CaMer0n CaMer0n added this to the e107 2.1.8 milestone May 5, 2018
@CaMer0n
Copy link
Member Author

CaMer0n commented May 5, 2018

Commit ed36008

@CaMer0n CaMer0n closed this as completed May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A problem that should not be happening type: enhancement An improvement or new feature request
Projects
None yet
Development

No branches or pull requests

1 participant