Page MenuHomePhabricator

qpLinkToSpan returns 'false' rather than content string if no anchors in html doc
Closed, DeclinedPublic

Description

qpLinkToSpan is supposed to return a string representing the html page being processed. However, if your HTML page has no anchor elements (unrealistic in the real world, but my testing file for import has only text) qpLinkToSpan returns FALSE. It should instead return the original content.

Context in which qpLinkToSpan is called. Notice assigning return value to mContent

$this->mContent = self::qpLinkToSpan($this->mContent);

Current master version:

    public static function qpLinkToSpan($content) {
        $qp = htmlqp($content, 'a');

        if ( $qp->length == 0 ) {           
	    return $content;
        }

My Modified Version:

    public static function qpLinkToSpan($content) {
        $qp = htmlqp($content, 'a');

        if ( $qp->length == 0 ) {
            // return false;
	    return $content;
        }

Event Timeline

Clunty89 raised the priority of this task from to Needs Triage.
Clunty89 updated the task description. (Show Details)
Clunty89 subscribed.