Merge pull request #2394 from annando/1603-federation
Small bugfix: Fixes problen when version number contains linebreaks
This commit is contained in:
commit
73f4c3c8da
1 changed files with 5 additions and 2 deletions
|
@ -283,14 +283,14 @@ function admin_page_federation(&$a) {
|
||||||
// get a total count for the platform, the name and version of the
|
// get a total count for the platform, the name and version of the
|
||||||
// highest version and the protocol tpe
|
// highest version and the protocol tpe
|
||||||
$c = q('SELECT count(*) AS total, platform, network, version FROM gserver
|
$c = q('SELECT count(*) AS total, platform, network, version FROM gserver
|
||||||
WHERE platform LIKE "%s" AND last_contact > last_failure
|
WHERE platform LIKE "%s" AND last_contact > last_failure AND `version` != ""
|
||||||
ORDER BY version ASC;', $p);
|
ORDER BY version ASC;', $p);
|
||||||
$total = $total + $c[0]['total'];
|
$total = $total + $c[0]['total'];
|
||||||
|
|
||||||
// what versions for that platform do we know at all?
|
// what versions for that platform do we know at all?
|
||||||
// again only the active nodes
|
// again only the active nodes
|
||||||
$v = q('SELECT count(*) AS total, version FROM gserver
|
$v = q('SELECT count(*) AS total, version FROM gserver
|
||||||
WHERE last_contact > last_failure AND platform LIKE "%s"
|
WHERE last_contact > last_failure AND platform LIKE "%s" AND `version` != ""
|
||||||
GROUP BY version
|
GROUP BY version
|
||||||
ORDER BY version;', $p);
|
ORDER BY version;', $p);
|
||||||
|
|
||||||
|
@ -344,6 +344,9 @@ function admin_page_federation(&$a) {
|
||||||
$v = $newVv;
|
$v = $newVv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($v as $key => $vv)
|
||||||
|
$v[$key]["version"] = trim(strip_tags($vv["version"]));
|
||||||
|
|
||||||
// the 3rd array item is needed for the JavaScript graphs as JS does
|
// the 3rd array item is needed for the JavaScript graphs as JS does
|
||||||
// not like some characters in the names of variables...
|
// not like some characters in the names of variables...
|
||||||
$counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p), $colors[$p]);
|
$counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p), $colors[$p]);
|
||||||
|
|
Loading…
Reference in a new issue