PyroStreams在图片网址中的图片名称之前的“文件”之后添加了一个额外的斜杠?

时间:2012-07-18 16:25:48

标签: pyrocms

由于某种原因,PyroStreams正在为url添加一个额外的斜杠。在所有经过测试的浏览器中,图像显示正常,但我的客户关注。我已经检查了我的.htaccess,但我看不出我会在哪里造成这种情况。这也发生在流接口中,这意味着我在代码中得到了额外的斜线。我没有碰过。

此:

<img src="{{ hero:image }}" width="305" alt="">

产生这个:

<img src="http://rococ.co/grandhelo/pyroapp/site/uploads/default/files//ssvs-hero.jpg" width="305" alt="">

这是好的衡量标准.htaccess:

# Multiple Environment config
# Set this to development, staging or production
# SetEnv PYRO_ENV production

<IfModule mod_rewrite.c>

# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on

# NOTICE: If you get a 404 play with combinations of the following commented out lines
#AllowOverride All
#RewriteBase /wherever/pyro/is

# Restrict your site to only one domain
# !important USE ONLY ONE OPTION

# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
#RewriteCond %{HTTP_HOST} (.+)$ [NC]
#RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

# Remove index.php from URL
RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

# Keep people out of codeigniter directory and Git/Mercurial data
RedirectMatch 403 ^/(system\/cms\/cache|system\/codeigniter|\.git|\.hg).*$

# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

<IfModule mod_php5.c>
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_php5.c>
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

</IfModule>

有没有人知道如何阻止这种行为,或者有任何见解我可以传递给我的客户解释这不是一个问题?

1 个答案:

答案 0 :(得分:1)

pyro_streams图片文件类型中存在错误。

adamfairholm发布了一个修正案: https://github.com/pyrocms/pyrocms/commit/f96cf0ac356935faea466c626a6f6ba829dc6684

304  304    
     {
305  305    
       $image = $db_obj->row();
306  306    

307     
-      $full = $this->CI->config->item('files:path') . '/' . $image->name;
     307    
+      $full = $this->CI->config->item('files:path').$image->name;
308  308    

309  309    
       $image_data['filename']    = $image->name;
310  310    
       $image_data['image']    = base_url().$full;
...  ...    
@@ -322,8 +322,8 @@ public function pre_output_plugin($input, $params)
322  322    
       if( file_exists( $path . '/'.$plain_name.'_thumb'.$image->extension ) )
323  323    
       {
324  324    

325     
-        $image_data['thumb']    = base_url().$this->CI->config->item('files:path') . '/' . $plain_name.'_thumb' . $image->extension;
326     
-        $image_data['thumb_img']  = img( array('alt'=>$image->name, 'src'=> $this->CI->config->item('files:path') . '/' . $plain_name.'_thumb' . $image->extension) );
     325    
+        $image_data['thumb']    = base_url().$this->CI->config->item('files:path').$plain_name.'_thumb' . $image->extension;
     326    
+        $image_data['thumb_img']  = img( array('alt'=>$image->name, 'src'=> $this->CI->config->item('files:path').$plain_name.'_thumb' . $image->extension) );
327  327    
       }
328  328    
       else
329  329    
       {