diff options
-rw-r--r-- | includes/unicode.inc | 4 | ||||
-rw-r--r-- | modules/dblog/dblog.test | 4 | ||||
-rw-r--r-- | modules/filter/filter.api.php | 2 | ||||
-rw-r--r-- | modules/forum/forum.test | 2 | ||||
-rw-r--r-- | modules/node/node.api.php | 2 | ||||
-rw-r--r-- | modules/node/node.test | 2 | ||||
-rw-r--r-- | modules/openid/openid.inc | 4 | ||||
-rw-r--r-- | modules/search/search.api.php | 8 | ||||
-rw-r--r-- | modules/simpletest/files/php-2.php | 1 | ||||
-rw-r--r-- | modules/simpletest/tests/cache.test | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/common.test | 4 |
11 files changed, 19 insertions, 18 deletions
diff --git a/includes/unicode.inc b/includes/unicode.inc index f25f472d2..8c2f64970 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -207,7 +207,9 @@ function drupal_truncate_bytes($string, $len) { if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) { return substr($string, 0, $len); } - while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0) {}; + // Scan backwards to beginning of the byte sequence. + while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0); + return substr($string, 0, $len); } diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index ca6be2f3c..76d10272d 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -189,7 +189,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->assertResponse(200); // Retrieve user object. $user = user_load_by_name($name); - $this->assertTrue($user != null, t('User @name was loaded', array('@name' => $name))); + $this->assertTrue($user != NULL, t('User @name was loaded', array('@name' => $name))); $user->pass_raw = $pass; // Needed by drupalLogin. // Login user. $this->drupalLogin($user); @@ -266,7 +266,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->assertResponse(200); // Retrieve node object. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title))); + $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); // Edit node. $edit = $this->getContentUpdate($type); $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); diff --git a/modules/filter/filter.api.php b/modules/filter/filter.api.php index 91515640e..695a33844 100644 --- a/modules/filter/filter.api.php +++ b/modules/filter/filter.api.php @@ -149,7 +149,7 @@ function hook_filter($op, $delta = 0, $format = -1, $text = '', $langcode = '', * * */ -function hook_filter_tips($delta, $format, $long = false) { +function hook_filter_tips($delta, $format, $long = FALSE) { if ($long) { return t('To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.'); } diff --git a/modules/forum/forum.test b/modules/forum/forum.test index 0ed99ad03..0b6da3839 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -257,7 +257,7 @@ class ForumTestCase extends DrupalWebTestCase { // Retrieve node object. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title))); + $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); // View forum topic. $this->drupalGet('node/' . $node->nid); diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 1383773c1..6e46b6cb7 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -601,7 +601,7 @@ function hook_prepare($node) { return; } $node->images['_original'] = $file->filepath; - _image_build_derivatives($node, true); + _image_build_derivatives($node, TRUE); $node->new_file = TRUE; } } diff --git a/modules/node/node.test b/modules/node/node.test index 24b660eb3..af4de828c 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -343,7 +343,7 @@ class PageEditTestCase extends DrupalWebTestCase { // Check that "edit" link points to correct page. $this->clickLink(t('Edit')); - $edit_url = url("node/$node->nid/edit", array('absolute' => true)); + $edit_url = url("node/$node->nid/edit", array('absolute' => TRUE)); $actual_url = $this->getURL(); $this->assertEqual($edit_url, $actual_url, t('On edit page.')); diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc index 7df2262d6..9bc4de789 100644 --- a/modules/openid/openid.inc +++ b/modules/openid/openid.inc @@ -154,7 +154,7 @@ function _openid_create_message($data) { foreach ($data as $key => $value) { if ((strpos($key, ':') !== FALSE) || (strpos($key, "\n") !== FALSE) || (strpos($value, "\n") !== FALSE)) { - return null; + return NULL; } $serialized .= "$key:$value\n"; } @@ -381,7 +381,7 @@ function _openid_dh_rand($stop) { } function _openid_get_bytes($num_bytes) { - static $f = null; + static $f = NULL; $bytes = ''; if (!isset($f)) { $f = @fopen(OPENID_RAND_SOURCE, "r"); diff --git a/modules/search/search.api.php b/modules/search/search.api.php index d810b6249..d54b60328 100644 --- a/modules/search/search.api.php +++ b/modules/search/search.api.php @@ -70,7 +70,7 @@ * * @ingroup search */ -function hook_search($op = 'search', $keys = null) { +function hook_search($op = 'search', $keys = NULL) { switch ($op) { case 'name': return t('Content'); @@ -262,13 +262,13 @@ function hook_update_index() { // Get node output (filtered and with module-specific fields). if (node_hook($node, 'view')) { - node_invoke($node, 'view', false, false); + node_invoke($node, 'view', FALSE, FALSE); } else { - $node = node_prepare($node, false); + $node = node_prepare($node, FALSE); } // Allow modules to change $node->body before viewing. - module_invoke_all('node_view', $node, false, false); + module_invoke_all('node_view', $node, FALSE, FALSE); $text = '<h1>' . drupal_specialchars($node->title) . '</h1>' . $node->body; diff --git a/modules/simpletest/files/php-2.php b/modules/simpletest/files/php-2.php index dc8e64213..615a8d78f 100644 --- a/modules/simpletest/files/php-2.php +++ b/modules/simpletest/files/php-2.php @@ -1,3 +1,2 @@ <?php print 'SimpleTest PHP was executed!'; -?>
\ No newline at end of file diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test index 35baea8af..5b856c5a6 100644 --- a/modules/simpletest/tests/cache.test +++ b/modules/simpletest/tests/cache.test @@ -18,8 +18,8 @@ class CacheTestCase extends DrupalWebTestCase { * @return * TRUE on pass, FALSE on fail. */ - protected function checkCacheExists($cid, $var, $table = null) { - if ($table == null) { + protected function checkCacheExists($cid, $var, $table = NULL) { + if ($table == NULL) { $table = $this->default_table; } diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 19a9cb54d..76f50977b 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -757,7 +757,7 @@ class DrupalDataApiTest extends DrupalWebTestCase { */ function testDrupalWriteRecord() { // Insert an object record for a table with a single-field primary key. - $vocabulary = new StdClass(); + $vocabulary = new stdClass(); $vocabulary->name = 'test'; $insert_result = drupal_write_record('taxonomy_vocabulary', $vocabulary); $this->assertTrue($insert_result == SAVED_NEW, t('Correct value returned when a record is inserted with drupal_write_record() for a table with a single-field primary key.')); @@ -769,7 +769,7 @@ class DrupalDataApiTest extends DrupalWebTestCase { $this->assertTrue($update_result == SAVED_UPDATED, t('Correct value returned when a record updated with drupal_write_record() for table with single-field primary key.')); // Insert an object record for a table with a multi-field primary key. - $vocabulary_node_type = new StdClass(); + $vocabulary_node_type = new stdClass(); $vocabulary_node_type->vid = $vocabulary->vid; $vocabulary_node_type->type = 'page'; $insert_result = drupal_write_record('taxonomy_vocabulary_node_type', $vocabulary_node_type); |