Saving a pdf template after server migration deletes spaces in the HTML styles

I recently migrated suitecrm to a online server from hosting it locally with XAMPP.

Everything works perfectly fine, except for updating pdf templates.

When i save a template it seems to delete white spaces in the html after : and ; for some reason.

And upon saving using the template for say saving a quote, its all messed up, everything is on top of everything else and the styling is messed up.

Example :
Old HTML before save

<table style="text-align: center; font-family: Arial; width: 1040px; height: 202px;" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr style="text-align: left;">
<td style="text-align: left;">
<p><img style="float: left;" src="custom/themes/default/images/company_logo.png" alt="" /> </p>
</td>
</tr>
<tr>
<td style="font-weight: bold; text-align: left;">
<p style="text-align: center;"><span style="font-size: x-small;"> REDACTED <span style="font-family: tahoma, arial, helvetica, sans-serif;">                                   REDACTED</span></span></p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td style="text-align: left;"><span style="font-size: large;"><strong><span style="color: #000000;"> 
<span style="font-size: medium;"><span style="font-size: x-small;"> </span>QUOTATION<span style="font-size: x-small;">      </span></span><span style="font-size: x-small;"> <strong>Quote Number:  $aos_quotes_number</strong></span></span></strong></span></td>
</tr>
</tbody>
</table>

After saving

<table style="text-align:center;font-family:Arial;width:1040px;height:202px;" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr style="text-align:left;">
<td style="text-align:left;">
<p><img style="float:left;" src="custom/themes/default/images/company_logo.png" alt="" /> </p>
</td>
</tr>
<tr>
<td style="font-weight:bold;text-align:left;">
<p style="text-align:center;"><span style="font-size:x-small;"> REDACTED<span style="font-family:tahoma, arial, helvetica, sans-serif;">                                   REDACTED</span></span></p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td style="text-align:left;"><span style="font-size:large;"><strong><span style="color:#000000;"><span style="font-size:medium;"><span style="font-size:x-small;"> </span>QUOTATION<span style="font-size:x-small;">      </span></span><span style="font-size:x-small;"> <strong>Quote Number:  $aos_quotes_number</strong></span></span></strong></span></td>
</tr>
</tbody>
</table>

As you can see all spaces have been trimmed after : and ; even tho there are plenty of spaces else where, it’s like php is trimming spaces after those characters.
Any idea how i can fix this, because at the moment if i want to create of edit a template, i have to do that on my old local version and grab the html from the database and then go and insert it onto my online database.

The old server is running the same version as php as the new one, the sql database is a few versions newer than the old server, but as far as i am aware this should not cause anything like this?

The only difference is that the new server uses https.

Any help would be greatly appreciated.

What a great community, second time Im asking for help on here.

Once again no response.

Are you a developer?

There are a couple of places where you can check…

A lot of replacements take place here:
modules/AOS_PDF_Templates/generatePdf.php

And some basic, generic ones (security-motivated, but often excessive), here:

Hey @Dantheman,

Sorry your question got missed, people will have taken a look but where unable to help so never chipped in.

Let’s see about investigating this further, some more info would be appreciated, what versions are you running (PHP, SuiteCRM, Apache, etc)?

@pgr comment should help with finding the source of where the stripping occurs also.

Thanks for the response @pgr and @Mac-Rae,

No I’m not a developer I just know some php, html, javascript, css, and mysql ( taught myself through the years as a hobby ).

SuiteCRM 7.10.18
PHP 5.6.40
Apache 2.4.43

Ok, stupid me.

I updated SuiteCRM to the latest LTS version, and now everything works.

Thanks for the help.