Page MenuHomePhabricator

moveToExternal and fixLegacyEncoding scripts are missing some checks for false return values
Open, Needs TriagePublic

Description

There are a few parts of moveToExternal.php and fixLegacyEncoding.php that call certain functions that can return false yet don't check for that return value, which indicates failure. The called functions include HistoryBlobCurStub::getText(), SqlBlobStore::expandBlob(), iconv(), and gzinflate().

So if I understand correctly, corrupted or missing data could incorrectly be stored in external storage as the empty string, or the gzdeflate()d empty string. To ensure that errors are generated and the corrupted records skipped, checks for false return values need to be added to the maintenance scripts.