Problem in post and preview of Mambo Bridge 2.2.

Started by weber, January 27, 2005, 04:04:13 AM

Previous topic - Next topic

weber

Hello. :)

I have managed the site with MOS 4.5.1a , SMF 1.0.1 , and MOS SMF BRIDGEv2.2stable. And, when advice can be gotten, it is welcome because it has a small problem in Mambo Bridge 2.2

Well. "\" is input to the message and when it is a post, it is displayed, "\\\\". For instance, when Smiley's " :-\" is input, it is displayed, ":-\\\\". And, it happens similarly on the preview.

And, the problem changes by accessed URL.

The problem happens when it accesses following URL.
http://bdc.s15.xrea.com/index.php?option=com_smf&Itemid=63&?board=9.0&language=english

The problem doesn't happen when it accesses following URL.
http://bdc.s15.xrea.com/forum/index.php?board=9.0&language=english

Please try and look. Thank you in advance.

Best regards,

koni

[Unknown]

The bridge may have problems if magic_quotes_gpc is off.  I would turn it on with a .htaccess.

-[Unknown]

weber

Thank you for the reply. :)

Your advice was adequate. Thank you very much!
I was able to evade this problem by adding the following code to .htaccess.

php_flag magic_quotes_gpc on

However, I noticed another problem. The character in the back disappears when inputting, "<". For instance, when inputting, "aaa<bbb", it is displayed, "aaa". The same problem happens even if this uses the tag of the code. And, this problem is not related to ON/OFF of magic_quotes_gpc. And, this problem changes similarly by URL, too.

Quote from: koni on January 27, 2005, 04:04:13 AM
The problem happens when it accesses following URL.
http://bdc.s15.xrea.com/index.php?option=com_smf&Itemid=63&?board=9.0&language=english

The problem doesn't happen when it accesses following URL.
http://bdc.s15.xrea.com/forum/index.php?board=9.0&language=english

When some advice can be gotten, I am glad. Thank you.

Best regards,

koni

[Unknown]

I think this is something Mambo is doing, although I'd swear there was a fix for it in smf.php.

-[Unknown]

weber

Thank you for the reply Mr. [Unknown]. :)

I have not understood though smf.php was opened and seen by me. :-[
And, I tested on some sites introduced by the topic below and saw. It seems to have the same problem on all sites where Bridge was used.

Examples of Mambo <-> SMF Bridge in use...
http://www.simplemachines.org/community/index.php?topic=25008.0

Does Developer of Bridge see this topic? Or, should I report to MamboForge?

Best regards,

koni

Orstio

Yes, what is happening is that Mambo is stripping out anything that resembles HTML.

v2.2 is supposed to take care of that with this:

if (!defined("_MOS_ALLOWHTML")){
  define( "_MOS_ALLOWHTML", 0x0002 );
}


Hmm...

What editor are you using in Mambo?


weber

Thank you for the response Mr. Orstio. :)

Quote from: Orstio on January 28, 2005, 04:50:16 AM
v2.2 is supposed to take care of that with this:

if (!defined("_MOS_ALLOWHTML")){
  define( "_MOS_ALLOWHTML", 0x0002 );
}


I found it from the 16th line to the 18th line in smf.php. Thank you.

Quote
What editor are you using in Mambo?

I am specifying "No WYSIWYG Editor" with Global Configuration. And, the problem was not solved in the following editor though it tested either.

TinyMCE WYSIWYG Editor v1.26
HTMLArea3 XTD v0.9.1 RC 1
TinyMCE4Mambo v1.0
fckeditor v2.0-RC2

Best regards,

koni


crashdummy

Strange problem, i can verify that!
For example:
<?php

if (in_array(9, $user_info['groups']))
  {
      echo
'Yay! Im in group 9!';
  }
else
  {
      echo
'We are sorry, it seems you dont have access to this page.';
  }

?>

You'll get a blank code tag in wrapped version!

weber

Thank you for the reply. :)

Quote from: crashdummy on January 28, 2005, 09:43:45 AM
Strange problem, i can verify that!

Is your site also the same?

Well, I tested clean Mos4.5.1a, SMF1.0.1, and Mambo Bridge 2.2 to the Windows system of the local by installing it by using phpdev. All of course files were downloaded from a regular place. The change is not added at all. Still the same problem occurred in the result of the test. The back is not displayed from "<".

@Mr. Orstio
I have the site written on Web by the above-mentioned and the site for the test of the state of the same. If you verify this problem, the Administrator password and the password of the FTP are sent with PM. There is no problem even if the password of the FTP freely is changed and destroys the test site. And, when you want a clean site, I construct it.

Best regards,

koni

Orstio

For a quick fix, you can do this:

In your Mambo includes folder, there is a file called mambo.php.  In it there is a function called mosGetParam().

Find this:

function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!($mask&_MOS_ALLOWHTML)) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}


and replace with this:

function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!defined("_MOS_ALLOWHTML")) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}


*Note that this is not a change recommended for everyone.

crashdummy


weber

Thank you very Mr. Orstio. The problem disappeared. :D
The thank you for sparing time due to this problem . I wish to express my gratitude to you.

Best regards,

koni


Goosemoose

That slash problem bugged for a long time. Even though both systems knew that magic quotes were on it wouldn't work until I forced it with the .htaccess file. You might want to add this to the faq ortiso.

Linkebal

It might also be usefull to tell what the actual addition to the .htaccess is. (At least, what works with me).

I tried making a .htaccess in the smf directory, but that didn't work, so I moved the code below to the .htaccess of the webroot. This file also includes Mambo's basisc rewriterules.

php_flag magic_quotes_runtime On
php_flag magic_quotes_gpc On
php_flag magic_qouts_sybase On

[Unknown]

Please note, if you have Apache 2 you need to use:

php_value magic_quotes_gpc 1

You don't really need/want sybase or runtime on.  Just the gpc one.

-[Unknown]

Linkebal


Antifreeze


Kindred

Just beware, if you made the change that Orstio suggested (to mambo.php)

If you INSTALL the SECURITY PATCH, you will have to make the same change to the new file.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rdawg

ok but what should i do if im running my site on a paid hosting with windows 2003 server !! and i have no .htaccess file :(

do u guyz think that the owner of the server will turn gpc on just because my site needs it ??  :(

Slowmac

I experienced this bug as well. I turned on magic quotes and it got rid of the \\\ marks. Now however I get a quote instead of an apostrophe.

Is there a better work around for this bug or do I need to continue on with the advice in this thread?

Quote from: Orstio on January 29, 2005, 04:36:26 AM
For a quick fix, you can do this:

In your Mambo includes folder, there is a file called mambo.php.  In it there is a function called mosGetParam().

Find this:

function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!($mask&_MOS_ALLOWHTML)) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}


and replace with this:

function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!defined("_MOS_ALLOWHTML")) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}


*Note that this is not a change recommended for everyone.

I ask because this is an older topic.

Advertisement: