2012-07-18 41 views
0

由於某些原因,PyroStreams正在爲url添加額外的斜線。在所有測試過的瀏覽器中,圖像都顯示得很好,但是我的客戶很擔心。我檢查了我的.htaccess,但我看不到會導致這種情況。這也發生在流接口中,這意味着我得到了額外的斜線代碼,我沒有觸及。PyroStreams在'images'之前的圖片名稱中添加了一個額外的斜槓?

此:

<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> 

有誰知道如何制止這種行爲,或有什麼我可以將這種洞察力傳遞給我的客戶解釋這不是一個問題?

+0

它有沒有關係htaccess的,它有與任何代碼生成的圖片src做。有沒有一個配置路徑,當它不應該有一個尾隨斜線? – 2012-07-18 16:32:01

+0

感謝您的快速回復。我沒有設置任何配置路徑,我在哪裏可以找到這個設置? – jayseeg 2012-07-18 16:46:41

回答

1

pyro_streams image filetype中存在一個錯誤。

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  
     { 
相關問題