core security update
This commit is contained in:
@@ -30,8 +30,9 @@
|
||||
*
|
||||
* @return
|
||||
* Array with optional keys:
|
||||
* - title: Title for the tab on the search page for this module. Defaults
|
||||
* to the module name if not given.
|
||||
* - title: Title for the tab on the search page for this module. Title must
|
||||
* be untranslated. Outside of this return array, pass the title through the
|
||||
* t() function to register it as a translatable string.
|
||||
* - path: Path component after 'search/' for searching with this module.
|
||||
* Defaults to the module name if not given.
|
||||
* - conditions_callback: An implementation of callback_search_conditions().
|
||||
@@ -39,6 +40,9 @@
|
||||
* @ingroup search
|
||||
*/
|
||||
function hook_search_info() {
|
||||
// Make the title translatable.
|
||||
t('Content');
|
||||
|
||||
return array(
|
||||
'title' => 'Content',
|
||||
'path' => 'node',
|
||||
|
@@ -409,10 +409,10 @@ class SearchQuery extends SelectQueryExtender {
|
||||
* used. However, if at least one call to addScore() has taken place, the
|
||||
* keyword relevance score is not automatically added.
|
||||
*
|
||||
* Also note that if you call orderBy() directly on the query, search scores
|
||||
* will not automatically be used to order search results. Your orderBy()
|
||||
* expression can reference 'calculated_score', which will be the total
|
||||
* calculated score value.
|
||||
* Note that you must use this method to add ordering to your searches, and
|
||||
* not call orderBy() directly, when using the SearchQuery extender. This is
|
||||
* because of the two-pass system the SearchQuery class uses to normalize
|
||||
* scores.
|
||||
*
|
||||
* @param $score
|
||||
* The score expression, which should evaluate to a number between 0 and 1.
|
||||
|
@@ -8,8 +8,8 @@ files[] = search.test
|
||||
configure = admin/config/search/settings
|
||||
stylesheets[all][] = search.css
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-04-02
|
||||
version = "7.36"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1427943826"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
@@ -49,7 +49,7 @@ function search_view($module = NULL, $keys = '') {
|
||||
// which will get us back to this page callback. In other words, the search
|
||||
// form submits with POST but redirects to GET. This way we can keep
|
||||
// the search query URL clean as a whistle.
|
||||
if (empty($_POST['form_id']) || $_POST['form_id'] != 'search_form') {
|
||||
if (empty($_POST['form_id']) || ($_POST['form_id'] != 'search_form' && $_POST['form_id'] != 'search_block_form')) {
|
||||
$conditions = NULL;
|
||||
if (isset($info['conditions_callback']) && function_exists($info['conditions_callback'])) {
|
||||
// Build an optional array of more search conditions.
|
||||
|
@@ -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' => '&');
|
||||
$this->drupalPost('search/node', $edit, t('Search'));
|
||||
$this->assertNoRaw('<strong>&</strong>amp;');
|
||||
$this->assertText('You must include at least one positive keyword');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-04-02
|
||||
version = "7.36"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1427943826"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-04-02
|
||||
version = "7.36"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1427943826"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-04-02
|
||||
version = "7.36"
|
||||
; Information added by Drupal.org packaging script on 2016-10-05
|
||||
version = "7.51"
|
||||
project = "drupal"
|
||||
datestamp = "1427943826"
|
||||
datestamp = "1475694174"
|
||||
|
||||
|
Reference in New Issue
Block a user