[index] Use function instead of building GitHub issue link manually

This commit is contained in:
logmanoriginal 2017-07-29 00:52:08 +02:00
parent 172cd491c1
commit 7eb13612e6

View File

@ -166,21 +166,15 @@ try {
$bridge->setCache($cache); $bridge->setCache($cache);
$bridge->setDatas($params); $bridge->setDatas($params);
} catch(Exception $e){ } catch(Exception $e){
$title = urlencode($bridge->getName() . ' failed with error ' . $e->getCode()); $title = $bridge->getName() . ' failed with error ' . $e->getCode();
// Build a GitHub compatible message // Build a GitHub compatible message
$body = urlencode('Error message: `' $body = 'Error message: `'
. $e->getmessage() . $e->getmessage()
. "`\nQuery string: `" . "`\nQuery string: `"
. $_SERVER['QUERY_STRING'] . '`' . $_SERVER['QUERY_STRING'] . '`';
);
$link = 'https://github.com/rss-bridge/rss-bridge/issues/new?title=' $link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer());
. $title
. '&body='
. $body
. '&labels=bug+report&assignee='
. $bridge->getMaintainer();
$message = <<<EOD $message = <<<EOD
<!DOCTYPE html> <!DOCTYPE html>
@ -213,21 +207,15 @@ EOD;
$format->setExtraInfos($bridge->getExtraInfos()); $format->setExtraInfos($bridge->getExtraInfos());
$format->display(); $format->display();
} catch(Exception $e){ } catch(Exception $e){
$title = urlencode($bridge->getName() . ' failed with error ' . $e->getCode()); $title = $bridge->getName() . ' failed with error ' . $e->getCode();
// Build a GitHub compatible message // Build a GitHub compatible message
$body = urlencode('Error message: `' $body = 'Error message: `'
. $e->getmessage() . $e->getmessage()
. "`\nQuery string: `" . "`\nQuery string: `"
. $_SERVER['QUERY_STRING'] . '`' . $_SERVER['QUERY_STRING'] . '`';
);
$link = 'https://github.com/rss-bridge/rss-bridge/issues/new?title=' $link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer());
. $title
. '&body='
. $body
. '&labels=bug+report&assignee='
. $bridge->getMaintainer();
$message = <<<EOD $message = <<<EOD
<!DOCTYPE html> <!DOCTYPE html>