Skip to content

Commit

Permalink
Merge pull request #7581 from Sesquipedalian/unicode_auto_update
Browse files Browse the repository at this point in the history
Updates Unicode data files in a background task
  • Loading branch information
Sesquipedalian authored Sep 21, 2023
2 parents 2148c43 + 60580a1 commit b422e7a
Show file tree
Hide file tree
Showing 5 changed files with 2,148 additions and 1,293 deletions.
6 changes: 6 additions & 0 deletions Sources/ScheduledTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,12 @@ function scheduled_weekly_maintenance()
array('$sourcedir/tasks/UpdateTldRegex.php', 'Update_TLD_Regex', '', 0), array()
);

// Ensure Unicode data files are up to date
$smcFunc['db_insert']('insert', '{db_prefix}background_tasks',
array('task_file' => 'string-255', 'task_class' => 'string-255', 'task_data' => 'string', 'claimed_time' => 'int'),
array('$sourcedir/tasks/UpdateUnicode.php', 'Update_Unicode', '', 0), array()
);

// Run Cache housekeeping
if (!empty($cache_enable) && !empty($cacheAPI))
$cacheAPI->housekeeping();
Expand Down
4 changes: 3 additions & 1 deletion Sources/Subs-Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
if (!defined('SMF'))
die('No direct access...');

require_once($sourcedir . '/Unicode/Metadata.php');
// If this file is missing, we're using an old version of Unicode.
if (!@include_once($sourcedir . '/Unicode/Metadata.php'))
define('SMF_UNICODE_VERSION', '14.0.0.0');

/**
* Converts the given UTF-8 string into lowercase.
Expand Down
Loading

0 comments on commit b422e7a

Please sign in to comment.