• Welcome to Simple Machines Community Forum. Please login or sign up.
January 26, 2022, 05:38:15 PM

News:

SMF 2.0.19 has been released! Please update. Read more.


© in template causes wsod

Started by Sir Osis of Liver, October 04, 2021, 12:54:07 PM

Previous topic - Next topic

Sir Osis of Liver

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

shadav

erm....

coding mistake? is it not in an echo?
how are you adding the symbol?
©works for me

Sir Osis of Liver

I know how to get around it, but if you copy the actual © character it crashes the page.  Just curious why it happens.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

shadav

not sure...just tested copied the one you posted there and put it in my index.template.php
it just doesn't render the image for me, no white screen
You cannot see attachments on this board.

smf version? theme in use? maybe post the code you are trying to use? 🤷‍♀️

Sir Osis of Liver

If you add © to copyright in clean Curve install, you'll get wsod.


    <li class="copyright">©', theme_copyright(), '</li>


Was fixing this problem, attached images were being damaged by copyright added to index.template.php -


       // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
        echo '
            <div id="footer">
                <ul class="reset">
                    </li>               
                    <li>', theme_copyright(), '</li>
                    <li class="copyright "><strong><style scoped>
            .blackText {color:black;}
            </style>
            <p class="blackText">© 2021 COPYRIGHT.COM</p>
            </div>
            </p>
            <a> </ul>
                </ul>';
                                                               
                // Show the load time?


Apparently this wonky code was used to get © to display without crashing page.  It works, but for reasons unknown screws up attachments so images don't display.  Changed it to this -


                <ul class="reset">
                    <li>', theme_copyright(), '</li>
                    <li style="color: black; font-weight: bold;">&copy; 2021 COPYRIGHT.COM</li>
                </ul>';


It displays copyright exactly same as original code, and fixed the attachments problem.  Don't really have any idea why.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

gecitli

Quote from: Sir Osis of Liver on October 04, 2021, 12:54:07 PMWhy?  ???


try this
<li class="copyright"><a href="', $scripturl, '">', $context['forum_name'], ' &copy; ', date('Y'), '</a></li>
http://www.webtiryaki.com
webmaster forumu
Free & Premium Responsive Themes for SMF.

Kindred

well, I can't get it to crash....  but since the (c) character is extended and is more properly represented with the html entity in code -- using it is wrong anyway.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shadav

something else must be up
tested on my test site
vanilla smf 2.0.18
<li class="copyright">©', theme_copyright(), '</li>You cannot see attachments on this board.

not sure what  would  be conflicting with it though

shawnb61

Quote from: Sir Osis of Liver on October 04, 2021, 12:54:07 PMWhy?  ???


The copyright symbol is not part of standard ASCII.  In ISO-8859-1 it is considered a "special character", and you should entity encode those if you are not yet utf8.

If your webpage is utf8 it will actually display properly.  If your webpage is still ISO-8859-1, at best, it will display funky, something like "© ".

In a vanilla 2.0 latin1 instance, it doesn't wsod (I just confirmed this also)...  But it definitely displays funky.

Your webpage charset can be found in the settings table, global_character_set.  Or you can view the page source in your browser & look for the meta tag for charset=.

Having that copyright symbol there is not vanilla code.  Some mod or theme put it there.

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

It was put there manually as part of the added copyright.  It works in the code they were using, but that code breaks attached images, no idea why.  Using the © character in the <li> crashes the page on OP's server and mine in clean install.  I'm running in utf8 on test install.  Works fine using &copy;.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

shawnb61

Hmmm...  Did you check global_character_set, or the meta charset?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

<sigh> It's not happening now on test forum. >:(
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Wellwisher

Try adding it as CSS content ie before/ after


Advertisement: