Changeset 643


Ignore:
Timestamp:
06/22/2011 08:37:01 PM (11 months ago)
Author:
ofer
Message:

fixes a tag with an empty href issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/core/parser.php

    r633 r643  
    133133    /** @var array Contains reference to changable option values */ 
    134134    private $otags = array(); 
     135    private $edit_span_created = false; 
    135136 
    136137    /** 
     
    545546        // Use base64 encoding to make that when the page is translated (i.e. update_translation) we 
    546547        // get back exactlly the same string without having the client decode/encode it in anyway. 
     548        $this->edit_span_created = true; 
    547549        $span = '<span class ="' . SPAN_PREFIX . '" id="' . SPAN_PREFIX . $this->span_id . '" data-token="' . transposh_utils::base64_url_encode($original_text) . '" data-source="' . $source . '"'; 
    548550        // if we have a source language 
     
    712714        // fix urls... 
    713715        foreach ($this->atags as $e) { 
    714             $e->href = call_user_func_array($this->url_rewrite_func, array($e->href)); 
     716            if ($e->href) $e->href = call_user_func_array($this->url_rewrite_func, array($e->href)); 
    715717        } 
    716718        foreach ($this->otags as $e) { 
    717             $e->value = call_user_func_array($this->url_rewrite_func, array($e->value)); 
     719            if ($e->value) $e->value = call_user_func_array($this->url_rewrite_func, array($e->value)); 
    718720        } 
    719721 
     
    866868        $this->stats->stop_timing(); 
    867869        $head = $this->html->find('head', 0); 
    868         if ($head != null) $head->lastChild()->outertext .= $this->added_header; 
     870        if ($this->edit_span_created) { 
     871            if ($head != null) { 
     872                $head->lastChild()->outertext .= $this->added_header; 
     873            } 
     874        } 
     875        //exit; 
    869876        if ($head != null) 
    870877                $head->lastChild()->outertext .= "\n<meta name=\"translation-stats\" content='" . json_encode($this->stats) . "'/>"; 
Note: See TracChangeset for help on using the changeset viewer.