summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-08-17 21:31:13 +0000
committerDries Buytaert <dries@buytaert.net>2010-08-17 21:31:13 +0000
commit2d3af8fe80715bb8b682f00272e731619d3102a8 (patch)
tree6e5bf36733e4b8d70af8afd24310694d4d0aabaf /modules/simpletest/tests
parent946a8d5967f30282b5fc899ee4ea7ae3708d9398 (diff)
downloadbrdo-2d3af8fe80715bb8b682f00272e731619d3102a8.tar.gz
brdo-2d3af8fe80715bb8b682f00272e731619d3102a8.tar.bz2
- Patch #829822 by pwolanin, tstoeckler: check Drupal 7 core for vulnerabilities in SA-CONTRIB-2010-066.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/common.test9
-rw-r--r--modules/simpletest/tests/common_test.module6
2 files changed, 9 insertions, 6 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 61e6f8d26..315b77622 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -749,8 +749,9 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
*/
function testAddCssFileWithQueryString() {
$this->drupalGet('common-test/query-string');
- $query_string = substr(variable_get('css_js_query_string', '0'), 0, 1);
- $this->assertRaw(drupal_get_path('module', 'node') . '/node.css?arg1=value1&amp;arg2=value2&amp;' . $query_string, t('Query string was appended correctly to css.'));
+ $query_string = variable_get('css_js_query_string', '0');
+ $this->assertRaw(drupal_get_path('module', 'node') . '/node.css?' . $query_string, t('Query string was appended correctly to css.'));
+ $this->assertRaw(drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&amp;arg2=value2', t('Query string not escaped on a URI.'));
}
}
@@ -1354,8 +1355,8 @@ class JavaScriptTestCase extends DrupalWebTestCase {
*/
function testAddJsFileWithQueryString() {
$this->drupalGet('common-test/query-string');
- $query_string = substr(variable_get('css_js_query_string', '0'), 0, 1);
- $this->assertRaw(drupal_get_path('module', 'node') . '/node.js?arg1=value1&amp;arg2=value2&amp;' . $query_string, t('Query string was appended correctly to js.'));
+ $query_string = variable_get('css_js_query_string', '0');
+ $this->assertRaw(drupal_get_path('module', 'node') . '/node.js?' . $query_string, t('Query string was appended correctly to js.'));
}
}
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module
index 7320bdaa7..449da4a97 100644
--- a/modules/simpletest/tests/common_test.module
+++ b/modules/simpletest/tests/common_test.module
@@ -220,7 +220,9 @@ function common_test_library() {
* Adds a JavaScript file and a CSS file with a query string appended.
*/
function common_test_js_and_css_querystring() {
- drupal_add_js(drupal_get_path('module', 'node') . '/node.js?arg1=value1&arg2=value2');
- drupal_add_css(drupal_get_path('module', 'node') . '/node.css?arg1=value1&arg2=value2');
+ drupal_add_js(drupal_get_path('module', 'node') . '/node.js');
+ drupal_add_css(drupal_get_path('module', 'node') . '/node.css');
+ // A relative URI may have a query string.
+ drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2');
return '';
}