includes/menu.inc | 3 ++- modules/file/file.module | 4 ++-- modules/taxonomy/taxonomy.module | 11 +++-------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/includes/menu.inc b/includes/menu.inc index 3a376f2..5ea8302 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2388,11 +2388,12 @@ function menu_link_get_preferred($path = NULL) { if ($candidate_item['access']) { $preferred_links[$path] = $candidate_item; } - break 2; + goto found; } } } + found: return $preferred_links[$path]; } diff --git a/modules/file/file.module b/modules/file/file.module index 4002701..43fdb3a 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -196,8 +196,7 @@ function file_file_download($uri, $field_type = 'file') { if (in_array(TRUE, $grants)) { // If TRUE is returned, access is granted and no further checks are // necessary. - $denied = FALSE; - break 3; + goto access_granted; } if (in_array(FALSE, $grants)) { @@ -216,6 +215,7 @@ function file_file_download($uri, $field_type = 'file') { } // Access is granted. + access_granted: $headers = file_get_content_headers($file); return $headers; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index dc2847d..cf0681e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1313,15 +1313,12 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang // Check each existing item to ensure it can be found in the // allowed values for this field. foreach ($items as $delta => $item) { - $validate = TRUE; if (!empty($item['tid']) && $item['tid'] != 'autocreate') { - $validate = FALSE; foreach ($field['settings']['allowed_values'] as $settings) { // If no parent is specified, check if the term is in the vocabulary. if (isset($settings['vocabulary']) && empty($settings['parent'])) { if ($settings['vocabulary'] == $terms[$item['tid']]->vocabulary_machine_name) { - $validate = TRUE; - break; + goto validated; } } // If a parent is specified, then to validate it must appear in the @@ -1330,18 +1327,16 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang $ancestors = taxonomy_get_parents_all($item['tid']); foreach ($ancestors as $ancestor) { if ($ancestor->tid == $settings['parent']) { - $validate = TRUE; - break 2; + goto validated; } } } } - } - if (!$validate) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'taxonomy_term_reference_illegal_value', 'message' => t('%name: illegal value.', array('%name' => $instance['label'])), ); + validated: } } }