Comments

JamesAn’s picture

Status: Active » Needs review
StatusFileSize
new2.91 KB
catch’s picture

Status: Needs review » Reviewed & tested by the community

Not sure why htmlcorrectory needs the statics at all there, but looks good anyway.

dries’s picture

Shouldn't + $no_nesting = &drupal_static(__FUNCTION__, drupal_map_assoc(array('li', 'p'))); be + $no_nesting = &drupal_static(__FUNCTION__ . ":no_nesting", drupal_map_assoc(array('li', 'p'))); for consistency?

catch’s picture

Generally we've only been suffixing statics when we have to (i.e. http://api.drupal.org/api/function/taxonomy_get_tree/7 which was one of the first patches to go in), I can see arguments both ways though.

JamesAn’s picture

Yes, the pattern seemed to not suffix the first static var.

catch’s picture

The reasoning for this is documented in the update docs: http://drupal.org/node/224333#static_variable_api

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

dave reid’s picture

Issue tags: +Novice

Adding novice tag.

JamesAn’s picture

Status: Needs work » Needs review
StatusFileSize
new2.91 KB

Rerolled.

Status: Needs review » Needs work

The last submitted patch failed testing.

JuliaKM’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB

This patch is re-rolled minus the changes to _filter_htmlcorrector, which has been rewritten to use PHP5 and no longer needs &drupal_static(__FUNCTION__).

Status: Needs review » Needs work

The last submitted patch failed testing.

alonpeer’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB

Patch re-work.

Status: Needs review » Needs work

The last submitted patch failed testing.

JamesAn’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

Rerolled. Some of the changes were already made so the patch is smaller.

sun’s picture

Status: Needs review » Needs work
+++ modules/filter/filter.module	28 Oct 2009 06:32:32 -0000
@@ -1069,7 +1069,7 @@ function _filter_url_parse_partial_links
 function _filter_url_trim($text, $length = NULL) {
-  static $_length;
+  $_length = &drupal_static(__FUNCTION__);
   if ($length !== NULL) {

This conversion makes no sense, because this function is an internal preg_replace callback for _filter_url(). No module has a chance to intercept the operation anyway.

However, while being there and reverting the change, please change the if condition to use isset($length) instead of this awkward NULL test.

This review is powered by Dreditor.

sun’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new1014 bytes
sun’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

#562932: {filter_format}.cache is not saved will remove this static entirely.