Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser don't work if we have postbit profie fields #1260

Closed
DiogoParrinha opened this issue Aug 18, 2014 · 4 comments
Closed

Parser don't work if we have postbit profie fields #1260

DiogoParrinha opened this issue Aug 18, 2014 · 4 comments
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Milestone

Comments

@DiogoParrinha
Copy link
Contributor

Hi,
If we have a profile field that shown in postbit, the MyCode parser don't work.

why:
in functions_post.php in line 70 defined $parser_options but it defined again in line 432 :-|

fix:
in functions_post.php
find:
PHP Code:
​                        $parser_options = array(                            "allow_html" => $field['allowhtml'],                            "allow_mycode" => $field['allowmycode'],                            "allow_smilies" => $field['allowsmilies'],                            "allow_imgcode" => $field['allowimgcode'],                            "allow_videocode" => $field['allowvideocode'],                            #"nofollow_on" => 1,                            "filter_badwords" => 1                        );                        if($customfield['type'] == "textarea")                        {                            $parser_options['me_username'] = $post['username'];                        }                        else                        {                            $parser_options['nl2br'] = 0;                        }                        if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)                        {                            $parser_options['allow_imgcode'] = 0;                        }                        $post['fieldvalue'] = $parser->parse_message($post[$fieldfid], $parser_options);                    }                    eval("\$post['profilefield'] .= \"".$templates->get("postbit_profilefield")."\";"); 
Replace to:
PHP Code:
​                        $field_parser_options = array(                            "allow_html" => $field['allowhtml'],                            "allow_mycode" => $field['allowmycode'],                            "allow_smilies" => $field['allowsmilies'],                            "allow_imgcode" => $field['allowimgcode'],                            "allow_videocode" => $field['allowvideocode'],                            #"nofollow_on" => 1,                            "filter_badwords" => 1                        );                        if($customfield['type'] == "textarea")                        {                            $field_parser_options['me_username'] = $post['username'];                        }                        else                        {                            $field_parser_options['nl2br'] = 0;                        }                        if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)                        {                            $field_parser_options['allow_imgcode'] = 0;                        }                        $post['fieldvalue'] = $parser->parse_message($post[$fieldfid], $field_parser_options);                    }                    eval("\$post['profilefield'] .= \"".$templates->get("postbit_profilefield")."\";"); 

Original thread: Parser don't work if we have postbit profie fields

@DiogoParrinha DiogoParrinha added this to the 1.8.0 milestone Aug 18, 2014
ATofighi added a commit to ATofighi/mybb_ that referenced this issue Aug 18, 2014
Parser don't work if we have postbit profie fields
@ATofighi
Copy link
Contributor

Fixed in #1262

@Sama34
Copy link
Contributor

Sama34 commented Aug 19, 2014

@ATofighi was your PR merged?

ATofighi added a commit to ATofighi/mybb_ that referenced this issue Aug 19, 2014
@ATofighi
Copy link
Contributor

Oh :D :D No (:
Sorry I deleted the branch of my PR yesterday :D :)
Now #1262 is OK :)

ATofighi added a commit to ATofighi/mybb_ that referenced this issue Aug 19, 2014
Starpaul20 added a commit that referenced this issue Aug 19, 2014
Fixes #1260 - Parser don't work if we have postbit profie fields
@Starpaul20
Copy link
Member

Merged PR. All is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Projects
None yet
Development

No branches or pull requests

6 participants