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

Don't use server variables in CLI mode #939

Merged
merged 6 commits into from
Nov 26, 2018
Merged

Don't use server variables in CLI mode #939

merged 6 commits into from
Nov 26, 2018

Conversation

triatic
Copy link
Contributor

@triatic triatic commented Nov 21, 2018

No description provided.

Copy link
Contributor

@logmanoriginal logmanoriginal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Find below some comments to simplify the if-statements.

. $_SERVER['QUERY_STRING']
. "`\nVersion: `"
. "`\nQuery string: `";
if (isset($_SERVER['QUERY_STRING']))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a one line if-statement like this (keep the rest like before):

. isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''

	// Build a GitHub compatible message
	$body = 'Error message: `'
	. $e->getMessage()
	. "`\nQuery string: `"
	. (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '')
	. "`\nVersion: `"
	. Configuration::getVersion()
	. '`';

index.php Outdated
if (isset($_SERVER['REQUEST_URI']))
$item['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
else
$item['uri'] = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be a one line if-statement:

$item['uri'] = (isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '')
. '?' . http_build_query($params);

@logmanoriginal logmanoriginal merged commit 263e887 into RSS-Bridge:master Nov 26, 2018
@logmanoriginal
Copy link
Contributor

Merged, thanks!

infominer33 pushed a commit to web-work-tools/rss-bridge that referenced this pull request Apr 17, 2020
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.

2 participants