The ismozilla function of discuz is so late. I don't know if anyone else is there. The younger brother has encountered a problem in the middle of the night, so I am so grateful to you for passing. Discuz has a function that converts html code into ubb code. see the code functionhtml2bbcode ($ text discuz's ismozilla function
It's so late, I don't know if anyone else is there. The younger brother has encountered a problem in the middle of the night, so I can't explain it. thank you for your thanks.
Discuz has a function that converts html code into ubb code.
Function html2bbcode ($ text ){
$ Text = strip_tags ($ text ,'
-
Script ');
If (ismozilla ()){
$ Text = preg_replace ("/(? |
| \ R) (\ r \ n | \ r)/",'', $ text );
}
Only a part of the code is listed.
The above ismozilla function is used to determine the Firefox browser. the code is as follows:
Function ismozilla (){
$ Useragent = strtolower ($ _ SERVER ['http _ USER_AGENT ']);
If (strpos ($ useragent, 'Gecko ')! = FALSE ){
Preg_match ("/gecko \/(\ d +)/", $ useragent, $ regs );
Return $ regs [1];
}
Return FALSE;
}
We can see the red part of the code. What I don't understand is, why should Firefox destroy all the line breaks? Why?
I wrote a posting program triggered by a scheduled task. it is estimated that it was triggered by other things. after the function conversion, no line breaks were found in the post.
This is defined before using the html2bbcode function:
$ _ SERVER ['http _ USER_AGENT '] = 'mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 360EE ';
However, the Post is still not formatted with a line break, and I don't know how to solve it. it's strange to say that discuz defines this function, but there is no place to use it on the whole site, which is very strange.
------ Solution --------------------
More than one person writes code. Now that we have done this, we have changed the number of people we have come. In the end, the code becomes a scum, and the flow is in the center of the code. It is useless to search. it can only be explained. I forgot to remove it during Reconstruction.
------ Solution --------------------
This is a function that converts HTML tags to BBCode. This function is not required in discuz.
If you suspect it is this function, comment out the red part.
------ Solution --------------------
The problem is: Although you have modified the function, you still find that the problem persists.
------ Solution --------------------
It may be a judgment for css !!!
|