]> _ Git - cubeextranet.git/commitdiff
wait #3827 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 Jul 2020 18:01:13 +0000 (18:01 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 30 Jul 2020 18:01:13 +0000 (18:01 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 5d94086e0a2993e680f65a29079be09f318bebe7..8652544a091fcff9fa6cc737e254fab86dc25339 100644 (file)
@@ -2535,10 +2535,16 @@ class wsHTML5Compiler
                     if ($image === '') {
                         $image = 'articles/' . $file;
                     }
-                    $this->vdir->copy($this->wdir . '/articles/' . $file, 'data/articles/' . $file);
+                    $filepath = $this->wdir . '/articles/' . $file;
+                    $this->vdir->copy($filepath, 'data/articles/' . $file);
                     $legend = (string)$child;
                     $caption = $legend ? '<figcaption>' . $legend . '</figcaption>' : '';
-                    $inner .= '<figure><img src="data/articles/' . $file . '" alt="' . $legend . '">' . $caption . '</figure>';
+                    if (file_exists($filepath)) {
+                        $dim = getimagesize($filepath);
+                    } else {
+                        $dim = [0 => 1024, 1 => 10];
+                    }
+                    $inner .= '<figure><img src="data/articles/' . $file . '" alt="' . $legend . '" width="' . $dim[0] . '" height="' . $dim[1] . '">' . $caption . '</figure>';
                 } else {
                     $c = trim($this->SimpleXMLElement_innerXML($child));
                     if (!$c) {
index 53fb1622af8433405b4d2a589db0c7348e98b950..4942690b4f3a3b5a530002965112b12b663b9b1c 100644 (file)
@@ -2301,8 +2301,10 @@ class articleLink extends normalLink
     public function init()
     {
         parent::init();
-        $this->compiler->config->articlesList[$this->to]['page'] = $this->page;
         $this->article = $this->compiler->config->articlesList[$this->to];
+        if (!isset($this->compiler->config->articlesList[$this->to]['page'])) {
+            $this->compiler->config->articlesList[$this->to]['page'] = $this->page;
+        }
     }
 
     public function getURL()