Revision 620f9137
Added by Assos Assos over 4 years ago
drupal7/sites/all/modules/l10n_update/l10n_update.install | ||
---|---|---|
15 | 15 |
'name' => array( |
16 | 16 |
'description' => 'A unique short name to identify the project.', |
17 | 17 |
'type' => 'varchar', |
18 |
'length' => '50',
|
|
18 |
'length' => '255',
|
|
19 | 19 |
'not null' => TRUE, |
20 | 20 |
), |
21 | 21 |
'project_type' => array( |
... | ... | |
68 | 68 |
'project' => array( |
69 | 69 |
'description' => 'A unique short name to identify the project.', |
70 | 70 |
'type' => 'varchar', |
71 |
'length' => '50',
|
|
71 |
'length' => '255',
|
|
72 | 72 |
'not null' => TRUE, |
73 | 73 |
), |
74 | 74 |
'language' => array( |
... | ... | |
207 | 207 |
$requirements['l10n_update']['value'] = t('Not enabled'); |
208 | 208 |
$requirements['l10n_update']['severity'] = REQUIREMENT_INFO; |
209 | 209 |
} |
210 |
|
|
211 |
// Test the contents of the .htaccess file in the translations directory. |
|
212 |
$directory = variable_get('l10n_update_download_store', ''); |
|
213 |
if ($directory) { |
|
214 |
l10n_update_ensure_htaccess(); |
|
215 |
$htaccess_file = $directory . '/.htaccess'; |
|
216 |
// Check for the string which was added to the recommended .htaccess file |
|
217 |
// in the latest security update. |
|
218 |
if (!file_exists($htaccess_file) || !($contents = @file_get_contents($htaccess_file)) || strpos($contents, 'Drupal_Security_Do_Not_Remove_See_SA_2013_003') === FALSE) { |
|
219 |
$requirements['l10n_update_htaccess'] = array( |
|
220 |
'title' => t('Translations directory'), |
|
221 |
'value' => t('Not fully protected'), |
|
222 |
'severity' => REQUIREMENT_ERROR, |
|
223 |
'description' => t('See <a href="@url">@url</a> for information about the recommended .htaccess file which should be added to the %directory directory to help protect against arbitrary code execution.', array( |
|
224 |
'@url' => 'http://drupal.org/SA-CORE-2013-003', |
|
225 |
'%directory' => $directory |
|
226 |
)), |
|
227 |
); |
|
228 |
} |
|
229 |
} |
|
230 |
|
|
210 | 231 |
return $requirements; |
211 | 232 |
} |
212 | 233 |
// We must always return array, the installer doesn't use module_invoke_all() |
... | ... | |
297 | 318 |
function l10n_update_update_7006() { |
298 | 319 |
registry_rebuild(); |
299 | 320 |
} |
321 |
|
|
322 |
/** |
|
323 |
* Increase the length of the {l10n_update_project}.name column. |
|
324 |
*/ |
|
325 |
function l10n_update_update_7007() { |
|
326 |
$schema = l10n_update_schema(); |
|
327 |
db_change_field('l10n_update_project', 'name', 'name', $schema['l10n_update_project']['fields']['name']); |
|
328 |
} |
|
329 |
|
|
330 |
/** |
|
331 |
* Increase the length of the {l10n_update_file}.project column. |
|
332 |
*/ |
|
333 |
function l10n_update_update_7008() { |
|
334 |
$schema = l10n_update_schema(); |
|
335 |
db_change_field('l10n_update_file', 'project', 'project', $schema['l10n_update_file']['fields']['project']); |
|
336 |
} |
|
337 |
|
|
338 |
/** |
|
339 |
* Remove 'headers' field from cache table. |
|
340 |
*/ |
|
341 |
function l10n_update_update_7009() { |
|
342 |
if (db_field_exists('cache_l10n_update', 'headers')) { |
|
343 |
db_drop_field('cache_l10n_update', 'headers'); |
|
344 |
} |
|
345 |
} |
|
346 |
|
|
347 |
/** |
|
348 |
* Add a .htaccess file to the translations directory. |
|
349 |
*/ |
|
350 |
function l10n_update_update_7010() { |
|
351 |
module_load_include('module', 'l10n_update'); |
|
352 |
l10n_update_ensure_htaccess(); |
|
353 |
} |
Also available in: Unified diff
Weekly update of contrib modules