0

So, I'm working on a site. I didn't develop and I don't have access to the developers. The site uses a custom designed Bootstrap based theme, built with Page Builder. I just moved the site to a development server, and added myself a user and updated. The issue I'm having seems to be that one of the functions that write the page's HTML is messing up somewhere, and printing PHP into the CSS classes. The page's theme renders correctly on the production server, but don't write the correct class and style attributes on the dev server.

The output HTML with the PHP is

<div class="spacer spacer-60"></div></div></div></div></section><section data-anchor-title="Profile" data-anchor="profile" id="profile" class="<?print implode(' ',$classes); ?>" style="<?print implode(';',$styles); ?>">

I've poked around in the theme files, and there isn't an obvious place where the app is choking on this.

Thanks

0

Well, previous developer was a little bit naughty (;)) and used PHP short tags, which is a bad practice... And even worse - he used them a little bit wrong, I guess...

As you can see, there is something like this in your code:

style="<?print implode(';',$styles); ?>">

Of course there is no such thing like <?print in PHP, it should be <? print.

But you shouldn't use short tags (<?). They're turned off on some servers, so here's how to fix it:

<div class="spacer spacer-60"></div></div></div></div></section><section data-anchor-title="Profile" data-anchor="profile" id="profile" class="<?php print implode(' ', $classes); ?>" style="<?php print implode(';', $styles); ?>">

PS. Also... It would be nice to add some proper escaping in there...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.