Skip to content

Commit

Permalink
Merge pull request #23 from Indicia-Team/hotfix-import_rule_encoding
Browse files Browse the repository at this point in the history
Diacritics allowed in record cleaner rule files.
  • Loading branch information
johnvanbreda committed Oct 8, 2015
2 parents f245b6a + 6cafb5b commit 4ef3401
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @var string The application files version number.
*/
$config['version'] = '0.9.1.6';
$config['version'] = '0.9.1.7';
$config['release_date'] = '2015-10-08';
$config['repository'] = 'https://github.com/Indicia-Team/warehouse/releases';

Expand Down
3 changes: 3 additions & 0 deletions modules/data_cleaner/controllers/verification_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ private function internal_upload_rule_file($totaldone, $cacheArr) {
throw new exception("Could not open file $filepath");
}
$filecontent = fread($resource,1000000);
// if no BOM, not unicode, so convert for safety. See Warehouse issue 22.
if (strpos($filecontent, "\xEF\xBB\xBF")!==0)
$filecontent = utf8_encode($filecontent);
$settings = data_cleaner::parse_test_file($filecontent);
$this->read_rule_content($settings, $cacheArr['files'][$totaldone]['path'], $cacheArr['files'][$totaldone]['source_url']);
return $cacheArr['files'][$totaldone]['display'];
Expand Down

0 comments on commit 4ef3401

Please sign in to comment.