Skip to content
Snippets Groups Projects
Commit d26db48f authored by Lachlan Ennis's avatar Lachlan Ennis
Browse files

Issue #2748635 by elachlan, reevo, aburke626, amit.drupal: Code Standards Cleanup

parent cd979519
No related branches found
No related tags found
No related merge requests found
......@@ -293,14 +293,17 @@ function extlink_admin_settings_validate($form, &$form_state) {
}
}
/**
* Submit handler for admin settings form.
*/
function extlink_admin_settings_submit($form, &$form_state) {
// Append internal paths & aliases to exclude/include patterns
// Append internal paths & aliases to exclude/include patterns.
foreach (['exclude', 'include'] as $type) {
$internal = $form_state['values']['extlink_' . $type . '_internal'];
if ($internal && $internal != variable_get('extlink_' . $type . '_internal')) {
// Get lines
// Get lines.
$internal = array_filter(preg_split("/\r\n|\n|\r/", $internal));
// Add aliases
// Add aliases.
$internal = array_map(function ($v) {
$v = trim($v, '/ ');
$ret = [
......@@ -310,10 +313,9 @@ function extlink_admin_settings_submit($form, &$form_state) {
return implode('|', array_filter($ret));
}, $internal);
if (!empty($internal)) {
// Implode, add base url & escape slashes
// Implode, add base url & escape slashes.
global $base_url;
$internal = $base_url . '/(' . implode('|', array_filter($internal)) . ')';
// $internal = addcslashes($internal, '/');
}
else {
$internal = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment