Commit cccf98aa authored by Dries's avatar Dries

- Patch #265809 by dropcube: fixed some typos.

parent 4cdbf9c0
......@@ -559,10 +559,8 @@ function drupalGet($path, $options = array()) {
}
/**
* Do a post request on a drupal page.
* It will be done as usual post request with SimpleBrowser
* By $reporting you specify if this request does assertions or not
* Warning: empty ("") returns will cause fails with $reporting
* Execute a POST request on a Drupal page.
* It will be done as usual POST request with SimpleBrowser.
*
* @param string $path
* Location of the post form. Either a Drupal path or an absolute path or
......@@ -572,7 +570,7 @@ function drupalGet($path, $options = array()) {
* (where possible) to the values indicated. A checkbox can be set to
* TRUE to be checked and FALSE to be unchecked.
* @param string $submit
* Untranslated value, id or name of the submit button.
* Value of the submit button.
* @param $tamper
* If this is set to TRUE then you can post anything, otherwise hidden and
* nonexistent fields are not posted.
......@@ -600,7 +598,7 @@ function drupalPost($path, $edit, $submit, $tamper = FALSE) {
$action = isset($form['action']) ? $this->getAbsoluteUrl($form['action']) : $this->getUrl();
}
// We post only if we managed to handle every field in edit and the
// submit button matches;
// submit button matches.
if (!$edit && $submit_matches) {
// This part is not pretty. There is very little I can do.
if ($upload) {
......@@ -618,14 +616,15 @@ function drupalPost($path, $edit, $submit, $tamper = FALSE) {
$post_array = $post;
$post = array();
foreach ($post_array as $key => $value) {
// Whethet this needs to be urlencode or rawurlencode, is not
// Whether this needs to be urlencode or rawurlencode, is not
// quite clear, but this seems to be the better choice.
$post[] = urlencode($key) . '=' . urlencode($value);
}
$post = implode('&', $post);
}
$out = $this->curlExec(array(CURLOPT_URL => $action, CURLOPT_POSTFIELDS => $post, CURLOPT_POST => TRUE));
$this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
// Ensure that any changes to variables in the other thread are picked up.
$this->refreshVariables();
return $out;
}
}
......@@ -640,14 +639,19 @@ function drupalPost($path, $edit, $submit, $tamper = FALSE) {
/**
* Handle form input related to drupalPost(). Ensure that the specified fields
* exist and attempt to create POST data in the correct manor for the particular
* exist and attempt to create POST data in the correct manner for the particular
* field type.
*
* @param array $post Reference to array of post values.
* @param array $edit Reference to array of edit values to be checked against the form.
* @param string $submit Form submit button value.
* @param array $form Array of form elements.
* @return boolean Submit value matches a valid submit input in the form.
* @param array $post
* Reference to array of post values.
* @param array $edit
* Reference to array of edit values to be checked against the form.
* @param string $submit
* Form submit button value.
* @param array $form
* Array of form elements.
* @return boolean
* Submit value matches a valid submit input in the form.
*/
protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
// Retrieve the form elements.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment