0

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>

有谁知道如何制止这种行为,或者有任何见解可以传递给我的客户,解释这不是问题吗?

4

1 回答 1

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    
       {
于 2012-07-18T17:17:16.703 回答