Commit 6a351976 authored by Etienne CHAMPETIER's avatar Etienne CHAMPETIER

ZP-795 fix some bad sprintf.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 427797c3
......@@ -108,7 +108,7 @@ class LoopDetection extends InterProcessData {
*/
public static function GetProcessIdentifier() {
if (!isset(self::$processident))
self::$processident = sprintf('%04x%04', mt_rand(0, 0xffff), mt_rand(0, 0xffff));
self::$processident = sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff));
return self::$processident;
}
......
......@@ -876,7 +876,7 @@ class Sync extends RequestProcessor {
// check if the message is broken
if (ZPush::GetDeviceManager(false) && ZPush::GetDeviceManager()->DoNotStreamMessage($id, $data)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): message not to be streamed as requested by DeviceManager.", $id));
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): message not to be streamed as requested by DeviceManager, id = %s", $id));
$fetchstatus = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
}
}
......@@ -1143,7 +1143,7 @@ class Sync extends RequestProcessor {
private function importMessage($spa, &$actiondata, $todo, $message, $clientid, $serverid, $foldertype, $messageCount) {
// the importer needs to be available!
if ($this->importer == false)
throw StatusException(sprintf("Sync->importMessage(): importer not available", SYNC_STATUS_SERVERERROR));
throw StatusException("Sync->importMessage(): importer not available", SYNC_STATUS_SERVERERROR);
// mark this state as used, e.g. for HeartBeat
self::$deviceManager->SetHeartbeatStateIntegrity($spa->GetFolderId(), $spa->GetUuid(), $spa->GetUuidCounter());
......
......@@ -759,7 +759,7 @@ class ZPushAdmin {
$users = self::ListUsers($devid);
foreach ($users as $username) {
$seen++;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPushAdmin::FixStatesDeviceToUserLinking(): linking user '%s' to device '%d'", $username, $devid));
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPushAdmin::FixStatesDeviceToUserLinking(): linking user '%s' to device '%s'", $username, $devid));
if (ZPush::GetStateMachine()->LinkUserDevice($username, $devid))
$fixed++;
......
......@@ -75,7 +75,7 @@ class Webservice {
// the webservice command is handled by its class
if ($commandCode == ZPush::COMMAND_WEBSERVICE_USERS) {
if (!defined("ALLOW_WEBSERVICE_USERS_ACCESS") || ALLOW_WEBSERVICE_USERS_ACCESS !== true)
throw new HTTPReturnCodeException(sprintf("Access to the WebserviceUsers service is disabled in configuration. Enable setting ALLOW_WEBSERVICE_USERS_ACCESS.", Request::GetAuthUser()), 403);
throw new HTTPReturnCodeException("Access to the WebserviceUsers service is disabled in configuration. Enable setting ALLOW_WEBSERVICE_USERS_ACCESS", 403);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("Webservice::HandleWebservice('%s'): executing WebserviceUsers service", $commandCode));
......
......@@ -327,7 +327,7 @@ class ZPushTop {
$this->scrPrintAt($lc,0, sprintf("Open connections: %d\t\t\t\tUsers:\t %d\tZ-Push: %s ",count($this->activeConn),count($this->activeUsers), $this->getVersion())); $lc++;
$this->scrPrintAt($lc,0, sprintf("Push connections: %d\t\t\t\tDevices: %d\tPHP-MAPI: %s", $this->pushConn, count($this->activeDevices),phpversion("mapi"))); $lc++;
$this->scrPrintAt($lc,0, sprintf(" Hosts:\t %d", $this->pushConn, count($this->activeHosts))); $lc++;
$this->scrPrintAt($lc,0, sprintf(" Hosts:\t %d", count($this->activeHosts))); $lc++;
$lc++;
$this->scrPrintAt($lc,0, "\033[4m". $this->getLine(array('pid'=>'PID', 'ip'=>'IP', 'user'=>'USER', 'command'=>'COMMAND', 'time'=>'TIME', 'devagent'=>'AGENT', 'devid'=>'DEVID', 'addinfo'=>'Additional Information')). str_repeat(" ",20)."\033[0m"); $lc++;
......@@ -503,7 +503,7 @@ class ZPushTop {
}
else if ($cmds[0] == "option" || $cmds[0] == "o") {
if (!isset($cmds[1]) || $cmds[1] == "") {
$this->status = sprintf("Option value needs to be specified. See 'help' or 'h' for instructions", $cmds[1]);
$this->status = "Option value needs to be specified. See 'help' or 'h' for instructions";
$this->statusexpire = $this->currenttime+5;
}
else if ($cmds[1] == "p" || $cmds[1] == "push" || $cmds[1] == "ping")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment