@@ -343,36 +343,36 @@ |
||
343 | 343 | /** |
344 | 344 | * @param string $string |
345 | 345 | */ |
346 | - protected function AnalyseImgUrlString($string) |
|
347 | - { |
|
348 | - $start = '[IMG-REPLACE]'; |
|
349 | - $end = '[/IMG-REPLACE]'; |
|
350 | - |
|
351 | - if($string!=str_replace($start,'',$string) && $string==str_replace($start.$end,'',$string)) { |
|
352 | - $string = ' '.$string; |
|
353 | - $ini = strpos($string, $start); |
|
354 | - if ($ini == 0) { |
|
355 | - $url = ''; |
|
356 | - $rest = $string; |
|
357 | - } else { |
|
358 | - $ini += strlen($start); |
|
359 | - $len = ((strpos($string, $end, $ini)) - $ini); |
|
360 | - $url = substr($string, $ini, $len); |
|
361 | - |
|
362 | - $ini = strpos($string, $start); |
|
363 | - $len = strpos($string, $end, $ini + strlen($start)) + strlen($end); |
|
364 | - $rest = substr($string, 0, $ini).substr($string, $len); |
|
365 | - } |
|
366 | - } else { |
|
367 | - $url = ''; |
|
368 | - $rest = str_replace(array($start,$end),'',$string); |
|
369 | - } |
|
370 | - |
|
371 | - return [ |
|
372 | - 'url' => trim($url), |
|
373 | - 'rest' => trim($rest), |
|
374 | - ]; |
|
375 | - } |
|
346 | + protected function AnalyseImgUrlString($string) |
|
347 | + { |
|
348 | + $start = '[IMG-REPLACE]'; |
|
349 | + $end = '[/IMG-REPLACE]'; |
|
350 | + |
|
351 | + if($string!=str_replace($start,'',$string) && $string==str_replace($start.$end,'',$string)) { |
|
352 | + $string = ' '.$string; |
|
353 | + $ini = strpos($string, $start); |
|
354 | + if ($ini == 0) { |
|
355 | + $url = ''; |
|
356 | + $rest = $string; |
|
357 | + } else { |
|
358 | + $ini += strlen($start); |
|
359 | + $len = ((strpos($string, $end, $ini)) - $ini); |
|
360 | + $url = substr($string, $ini, $len); |
|
361 | + |
|
362 | + $ini = strpos($string, $start); |
|
363 | + $len = strpos($string, $end, $ini + strlen($start)) + strlen($end); |
|
364 | + $rest = substr($string, 0, $ini).substr($string, $len); |
|
365 | + } |
|
366 | + } else { |
|
367 | + $url = ''; |
|
368 | + $rest = str_replace(array($start,$end),'',$string); |
|
369 | + } |
|
370 | + |
|
371 | + return [ |
|
372 | + 'url' => trim($url), |
|
373 | + 'rest' => trim($rest), |
|
374 | + ]; |
|
375 | + } |
|
376 | 376 | |
377 | 377 | public function SaveAsPdf() |
378 | 378 | { |