The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ
1
0
Fork 0
Browse Source

Bug fixes and code beautification

* Fixed password masking when the message has more than one password
* Reading php://input in a separate line, for later debugging purposes
master
Polonkai Gergely 10 years ago
parent
commit
45f439ba68
  1. 3
      jsonRPCServer.php
  2. 5
      smsSender.php

3
jsonRPCServer.php

@ -47,7 +47,8 @@ class jsonRPCServer {
}
// reads the input data
$request = json_decode(file_get_contents('php://input'),true);
$request_string = file_get_contents('php://input');
$request = json_decode($request_string,true);
// executes the task on local object
try {

5
smsSender.php

@ -6,6 +6,7 @@ class smsSender
protected $sessionId = null;
protected $dbBackend;
protected $smsBackend;
const password_mask = '<masked password>';
public function __construct($dbBackend, $smsBackend, $sessionId)
{
@ -66,9 +67,11 @@ class smsSender
{
$msg = $message;
$mod = 0;
foreach ($passwordLocations as $loc)
{
$msg = substr_replace($msg, '<masked password>', $loc[0], $loc[1]);
$msg = substr_replace($msg, self::password_mask, $loc[0] + $mod, $loc[1]);
$mod += (strlen(self::password_mask) - $loc[1]);
}
return $msg;

Loading…
Cancel
Save