emoncms / MyHomeEnergyPlanner

My Home Energy Planner - Open Source home energy assessment software based on emoncms framework + openbem
GNU Affero General Public License v3.0
22 stars 27 forks source link

fix assessment.set_data for unencrypted saving #424

Closed fawkesley closed 4 years ago

fawkesley commented 5 years ago

when encryption was introduced in this commit it seems a regression was introduced for the unencrypted case

before (works):

$stmt->bind_param("ssi", $data, $mdate, $id);

after (fails):

$stmt->bind_param("sbi", $data, $mdate, $id);

from the docs we see that s means string and b means blob.

note: it's not clear to me why mdate (array('type' => 'int(11)')) should be treated as a string, but that's how it was before, and I've tested that ssi works when sbi does not.