From 6e723c5c5aef7e74fac9b98a51701a56b32dae3f Mon Sep 17 00:00:00 2001 From: James Rhodes Date: Wed, 28 Jan 2015 23:06:20 +0000 Subject: [PATCH] Use %B when writing to Harbormaster build logs Summary: Fixes T7007. Using `%B` permits non-UTF8 data to be appended to Harbormaster build logs. Since we're not really in control of the processes Harbormaster is running remotely, and since they may output invalid UTF8 data, we should store the invalid data instead of failing the build (due to UTF8 exception). Test Plan: @epriestley said this was the right fix, though I haven't tested it on our production system which actually exhibits the issue yet. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7007 Differential Revision: https://secure.phabricator.com/D11532 --- .../harbormaster/storage/build/HarbormasterBuildLog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php index d225de0f7f..4540f64d0a 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php @@ -123,7 +123,7 @@ final class HarbormasterBuildLog extends HarbormasterDAO 'INSERT INTO harbormaster_buildlogchunk '. '(logID, encoding, size, chunk) '. 'VALUES '. - '(%d, %s, %d, %s)', + '(%d, %s, %d, %B)', $this->getID(), self::ENCODING_TEXT, strlen($content),