/**
  * @param Range $range
  * @param $url
  *
  * @return string
  */
 public function getData(Range $range, $url)
 {
     $url = StringUtils::toNullTerminatedWchar($url);
     $options = $this->getOptions($url);
     $data = $this->getCommonData($range, $options);
     $data .= $this->getTextMarkData($url);
     return $this->getFullRecord($data);
 }
示例#2
0
 /**
  * @param Range $range
  * @param $url
  *
  * @return string
  */
 public function getData(Range $range, $url)
 {
     $url = StringUtils::toNullTerminatedWchar($url);
     $options = $this->getOptions($url);
     $data = $this->getCommonData($range, $options);
     $data .= pack("H*", static::MONIKER_GUID);
     $data .= pack("V", strlen($url));
     $data .= $url;
     return $this->getFullRecord($data);
 }
 /**
  * @param Range $range
  * @param $url
  *
  * @return string
  */
 public function getData(Range $range, $url)
 {
     $cellRef = null;
     if (preg_match("/\\#/", $url)) {
         $parts = explode('#', $url);
         $url = $parts[0];
         $cellRef = $parts[1];
     }
     // Calculate the up-level dir count e.g.. (..\..\..\ == 3)
     $upCount = preg_match_all("/\\.\\.\\\\/", $url, $useless);
     // Store the short dos dir name (null terminated)
     $urlWithoutDots = preg_replace("/\\.\\.\\\\/", '', $url) . "";
     // Unknown 24 bytes
     $unknown = pack("H*", 'FFFFADDE' . str_repeat('00', 20));
     $streamLen = pack("V", 0);
     $options = $this->getOptions($url);
     $data = $this->getCommonData($range, $options);
     $data .= pack("H*", static::MONIKER_GUID) . pack("v", $upCount) . pack("V", strlen($urlWithoutDots)) . $urlWithoutDots . $unknown . $streamLen;
     if ($cellRef) {
         $cellRef = StringUtils::toNullTerminatedWchar($cellRef);
         $data .= $this->getTextMarkData($cellRef);
     }
     return $this->getFullRecord($data);
 }