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

"=" in a URL #7

Open
diegargon opened this issue Nov 26, 2013 · 4 comments
Open

"=" in a URL #7

diegargon opened this issue Nov 26, 2013 · 4 comments

Comments

@diegargon
Copy link

If the [url='...'] have a '=' like "index.php?view=1"

$atribbs seems empty and get filled by

if(empty($attribs['default']))
$attribs['default'] = $content;

i think...

Result-> bad url

@doctorjbeam
Copy link

I'm also experiencing this issue.

@diegargon
Copy link
Author

In Document.php

line 878 (i think i edit and not check

change

if($attribs[0] == '=' && strrpos($attribs, '=') === 0)

if($attribs[0] == '=')

I don't now if this break something (possibility) , its a fast patch without try understand why that check, but now works for me if appears any error with url tag i will check again.

@diegargon
Copy link
Author

that check its for bbcodes with two arguments, if any bbcode have two arguements will get a error. i don't known which bbcode have two arguements

@Khalilbz
Copy link

The final solution it's working 100% but it needs some optimizations ^_^

In the classes/Node/Container/Document.php
change the parse function header to be like that

public function parse($str)
    {
        //$str      = preg_replace('/[\r\n|\r]/', "\n", $str);
        //This is the added code
        $bbstr = $str;
        $result = "";
        while (strpos($bbstr, "[url=") !== false) {
            $pos = strpos($bbstr, "[url=")+5;
            $result .= substr($bbstr,0,$pos);
            $bbstr = substr($bbstr,$pos,strlen($bbstr));
            $pos = strpos($bbstr, "]")-1;
            $link = substr($bbstr,0,$pos+1);if($pos<0)$link="#";
            $link = str_replace('=',"IXI_SBBCODEPARSER_URL_PROBLEM_IS_SOLVED",$link);
            $bbstr = substr($bbstr,$pos+1,strlen($bbstr));
            $result .= $link;
        }
        $result .= $bbstr;
        $str = $result;//The added code ends here


        $len      = strlen($str);
        $tag_open = false;
        $tag_text = '';
        $tag      = '';
...

And in the classes/Node/Container.php
change the function get_html() to oldget_html() then add this function :

/**
    *
    * @return string
    */
    public function get_html($nl2br=true){
        return str_replace("IXI_SBBCODEPARSER_URL_PROBLEM_IS_SOLVED",'=',$this->oldget_html($nl2br));
    }

and now every thing will run without any problem

Suggestion : I think that we can use @diegargon solution if we will be able to specify the tag ([URL]) in the IF statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants