DEDE solution to relative path problem when collecting paging articles
to collect articles for my good mother's child - care network today, it was found that DEDE took a bug on the page of the article.
just this evening, there are not many things. This little problem has also evoked the professional interest of my program. Simply open two bottles of beer, just a plate of peanuts, while drinking a little wine, with the code of debug DEDE, finally found the root of the problem and solved it.
Problem Description:
when the paging information is the absolute path in the collection target article (such as http://www.gudmama.com/a/tonghuagushi/2... 120_2.html) can be collected correctly.
page information is a relative path in the collection of target articles, but the "/ '/' /a/tonghuagushi/20120218/55120_2.html) DEDE can also be collected correctly.
if the paging information is a relative path in the collection target article, it can not be collected correctly at the beginning of '/' (such as a/tonghuagushi/20120218/55120_2.html) DEDE.
solution:
the root of the problem is FillUrl function in dedehtml2.class.php.
about 394 lines:
[code] if (strlen ($surl).Lt; 7)
{
$okurl = $this-.gt. KURL = preg_replace ('/^http:\/\//i',' ', $surl);
}
else
{
//$okurl = $this-.gt; BaseUrlPath.'/'.$surl;
= > / > [/ >] Code]
the annotated code is original, and the latter line is I add fix question.
a little eye reader who knows a little bit of program knows that the original program must have some problems. The first if and the last else code are the same.
it certainly doesn't make sense. I don't know how Dede programmers are review code.
today is a volunteer job, helping Dede fix solve this problem. I hope to help the stationmaster who has the same problem.