In case this helps anyone else out there I fixed it with the same versions of EE (2.2.2) and Matrix (2.2.2.1) as the OP and with php 5.4.x and php5.5.x.
Essentially I did a diff between the latest version of Matrix (2.5.10) and a couple of older ones and tracked it down to these two parts.
File: system/expressionengine/third_party/matrix/celltypes/file.php
Lines: 131 to 143
Replace this:
if ($this->_data_exists($data))
{
if (is_array($data))
{
$filedir = $data['filedir'];
$filename = $data['filename'];
}
else if (preg_match('/^{filedir_([0-9]+)}(.*)/', $data, $matches))
{
$filedir = $matches[1];
$filename = $matches[2];
}
}
With this:
if ($data)
{
if (is_array($data) && ! empty($data['filedir']) && ! empty($data['filename']))
{
$filedir = $data['filedir'];
$filename = $data['filename'];
}
else if (is_string($data) && preg_match('/^{filedir_([0-9]+)}(.*)/', $data, $matches))
{
$filedir = $matches[1];
$filename = $matches[2];
}
}
File: system/expressionengine/third_party/matrix/ft.matrix.php
Line: 1820
After this: $field_id = $this->settings['field_id'];
Add this:
if (empty($data))
{
$data = array();
}