core security update

This commit is contained in:
Bachir Soussi Chiadmi
2016-10-13 12:11:14 +02:00
parent 747127f643
commit 1a06561593
306 changed files with 7346 additions and 2431 deletions

View File

@@ -666,6 +666,24 @@ class SearchBlockTestCase extends DrupalWebTestCase {
url('search/node/', array('absolute' => TRUE)),
'Redirected to correct url.'
);
// Test that after entering a too-short keyword in the form, you can then
// search again with a longer keyword. First test using the block form.
$terms = array('search_block_form' => 'a');
$this->drupalPost('node', $terms, t('Search'));
$this->assertText('You must include at least one positive keyword with 3 characters or more');
$terms = array('search_block_form' => 'foo');
$this->drupalPost(NULL, $terms, t('Search'));
$this->assertNoText('You must include at least one positive keyword with 3 characters or more');
$this->assertText('Your search yielded no results');
// Same test again, using the search page form for the second search this time.
$terms = array('search_block_form' => 'a');
$this->drupalPost('node', $terms, t('Search'));
$terms = array('keys' => 'foo');
$this->drupalPost(NULL, $terms, t('Search'));
$this->assertNoText('You must include at least one positive keyword with 3 characters or more');
$this->assertText('Your search yielded no results');
}
}
@@ -2029,10 +2047,11 @@ class SearchNodeAccessTest extends DrupalWebTestCase {
}
/**
* Tests that search returns results with punctuation in the search phrase.
* Tests that search works with punctuation and HTML entities.
*/
function testPhraseSearchPunctuation() {
$node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were fuzzy.")))));
$node2 = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => 'Dignissim Aliquam & Quieligo meus natu quae quia te. Damnum© erat— neo pneum. Facilisi feugiat ibidem ratis.')))));
// Update the search index.
module_invoke_all('update_index');
@@ -2045,6 +2064,17 @@ class SearchNodeAccessTest extends DrupalWebTestCase {
$edit = array('keys' => '"bunny\'s"');
$this->drupalPost('search/node', $edit, t('Search'));
$this->assertText($node->title);
// Search for "&" and verify entities are not broken up in the output.
$edit = array('keys' => '&');
$this->drupalPost('search/node', $edit, t('Search'));
$this->assertNoRaw('<strong>&</strong>amp;');
$this->assertText('You must include at least one positive keyword');
$edit = array('keys' => '&amp;');
$this->drupalPost('search/node', $edit, t('Search'));
$this->assertNoRaw('<strong>&</strong>amp;');
$this->assertText('You must include at least one positive keyword');
}
}