MyTextSanitizer will be changed

xoopscube.org was upgraded to 2.1. Initially it seemed that xoopscube.org doesn’t have any problems. But, xoopscube.org had 3 bugs of Legacy so we had to fix them. One of them is MyTextSanitizer. In the latest Legacy, MyTextSanitizer is a simple adapter to Legacy_TextFilter interface. MyTextSanitizer is known as one of bad classes in XOOPS2.

In Legacy, all methods of MyTextSanitizer will stop using a reference parameter(&) which gets $text. Because XOOPS2 has a bug in that. In some cases, MyTextSanitizer lost the reference variable, and it returns a new variable which is generated when the reference is lost. Some modules need this bug to run correctly. Because Legacy has fixed this bug to keep reference variables, some modules encountered troubles in xoopscube.org. It’s difficult that MyTextSanitizer of Legacy emulates X2 bugs. And that’s also nonsense. Therefore we decided to stop using reference parameters.

But, MyTextSanitizer will not change the type of its return value which is references, because many modules have the following code;

$text =& $myts->xxxxx($text);

Changing the type of the return value means that many modules raises PHP Notice. So we will not do it. If you develop modules to 2.1 only, you should use $root->mTextFilter instead of MyTextSanitizer. Legacy_TextFilter which is a sub-class of XCube_TextFilter is made from a scratch and has good organized interfaces.

This changing may bring a problem to a few module. MyTextSanitzer took C style. So a few module will not run on Legacy correctly, if they have the following code;

$myts->xxxxx($text);
print $text;

Developers have to change this as the following;

$text =& $myts->xxxxx($text);

RC2 will be released after some bugs will be fixed. For more informations, read this thread.

Advertisements
This entry was posted in XOOPS Cube. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s