Menu

#595 text is limited in length

Rendering
open
nobody
php 5.2.x (4)
7
2012-10-11
2008-02-18
No

in phpwiki cvs version there seems to be a problem with long texts in phpwiki.

For testing purposes the text should be in one part (no crlf) and more than 2000 signs long.

after saving the text, the text is no longer shown. when editing the page again the text is there again ...

php5.2.5, Apache 2.2.8, mysql 5.0.45

Discussion

  • Nobody/Anonymous

    Logged In: NO

    after days of trying to solve the bug i gave up and returned to php4. The same bug is present in phpwiki 1.3.14 final also.

     
  • Nobody/Anonymous

    Logged In: NO

    after spending 200€ to come nearer to a solution, it seems to be a problem of $hugepat (line 82) in InlineParser.php.

    the function in line 185 closes with false when the line is to long. After making $hugepat shorter the text can be longer ...

    strange part of code there

     
  • Nobody/Anonymous

    Logged In: NO

    I have rewrote the stupid function _match in InlineParser.php. for me the limit is brocken and all seems to work. If someone is interested at the solution here is the code

    function _match ($text, $regexps, $repeat) {
        $posold = -1;
        $match = new RegexpSet_match;
            for ($i=0; $i < count($regexps); $i++) {                
                        if (!trim($regexps[$i])) {
                            trigger_error("empty regexp $i", E_USER_WARNING);
                            continue;
                        }
                        $pat= "/ ( . $repeat ) ( " . $regexps[$i] . " ) /Asx";
                        if (preg_match($pat, $text, $m)) {
                    if ($m[2]) {
                            $posakt = strpos($text, $m[2]);
                            if ((($posakt < $posold) || ($posold == -1)) && $m[2]){ 
                                        $posold = $posakt;
                                        $match->prematch = substr($text,0,$posakt);
                                        $delpart = substr($text,0,$posakt).$m[2];       
                                        $match->postmatch = substr($text, strlen($m[0]));
                                        $match->match = $m[2];
                                        $match->regexp_ind = $i;
                                }
                                }   else {
                                        $match->prematch = $text;
                                        $match->match = "";
                                        $match->regexp_ind = 0;
                                        $match->postmatch = "";
                                }
                        }
            }
            if (empty($match)) return false;
        return $match;
    }
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.