MyBB Community Forums

Full Version: Cache issue with CSS while saving
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi MyBB Team, I found an issue in 1.8.7 version of MyBB.

I will try to explain the issue, suppose there are images used in the theme and we minify the css using external tools so all lines of css come in one line.
Now the issue is when the theme cache is created only the first instance of the image is being modified to give relative path from cache folders and others are not which causes issue with other images not loading.

For example if the css code is this

a:link,a:visited{color:#0D5F7A;text-decoration:none}.header,body{text-align:center}.pmbg,ul#menu li{display:inline}.expcolimage,.smilie{vertical-align:middle}#footer,#m_menu,.clear{clear:both}body{background:url(images/focus/pattern.png) left top #666a73;color:#333;line-height:1.4;margin:0;font-family:tahoma,sans-serif,arial;font-size:13px;overflow-y:scroll}a:link{transition:all .25s ease!important}a:active,a:hover{text-decoration:underline}.header{position:fixed;top:0;left:0;width:100%;background:url(images/focus/pattern.png) left top #666A73;


Than it is changed to
a:link,a:visited{color:#0D5F7A;text-decoration:none}.header,body{text-align:center}.pmbg,ul#menu li{display:inline}.expcolimage,.smilie{vertical-align:middle}#footer,#m_menu,.clear{clear:both}body{background:url(../../../images/focus/pattern.png) left top #666a73;color:#333;line-height:1.4;margin:0;font-family:tahoma,sans-serif,arial;font-size:13px;overflow-y:scroll}a:link{transition:all .25s ease!important}a:active,a:hover{text-decoration:underline}.header{position:fixed;top:0;left:0;width:100%;background:url(images/focus/pattern.png) left top #666A73;

Where it should be changed to
a:link,a:visited{color:#0D5F7A;text-decoration:none}.header,body{text-align:center}.pmbg,ul#menu li{display:inline}.expcolimage,.smilie{vertical-align:middle}#footer,#m_menu,.clear{clear:both}body{background:url(../../../images/focus/pattern.png) left top #666a73;color:#333;line-height:1.4;margin:0;font-family:tahoma,sans-serif,arial;font-size:13px;overflow-y:scroll}a:link{transition:all .25s ease!important}a:active,a:hover{text-decoration:underline}.header{position:fixed;top:0;left:0;width:100%;background:url(../../../images/focus/pattern.png)


I had to manually search and replace it to give absolute path.

Regards
WallBB
Hi WallBB, sorry for the late reply. This may be related to https://github.com/mybb/mybb/issues/2804. Can you test the provided patch please? Thank you!
Hey Shade,
I don't have a board setup currently but I will try to set one asap and check this patch.
I hope that is okay ?

Regards
WallBB
This issue was fixed Smile can be closed