# Double Space Bug in CMS

**URL:** <https://forums.realmacsoftware.com/t/double-space-bug-in-cms/57800>\
**Category:** Elements CMS\
**Created:** [October 6, 2026, 9:43pm UTC](https://forums.realmacsoftware.com/t/double-space-bug-in-cms/57800 "2026-10-06T21:43:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [October 6, 2026, 9:43pm UTC](https://forums.realmacsoftware.com/t/double-space-bug-in-cms/57800/1 "2026-10-06T21:43:01Z")

</div>

![Screenshot 2026-10-06 at 4.39.30 PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/d/4/d44ccf8ca6f319cf45d14322ecbb00954637a504.png)

**Elements 3.1.1 (24668), CMS pages on a PHP 8 host**

Dates on three of my CMS sites were being published like this:

> 6th October,&10b00-07:00; 2026

**Cause**

The Text component held this, with two spaces before the `Y`:

```auto
{{item.date_published|date("jS F, Y")}}

```

When the page is published, Elements turns the double space into `&nbsp; `. It does this inside the `{{ }}` braces as well as in ordinary text, so the server receives a different date format:

```auto
{{item.date_published|date("jS F,&nbsp; Y")}}

```

If the collection uses Load More, you can see this converted line in the published page source, inside its `<template>`.

PHP then reads the letters of `&nbsp;` as date codes:

| Character | PHP reads it as | Prints |
| --- | --- | --- |
| `&` | plain text | `&` |
| `n` | month number | `10` |
| `b` | plain text | `b` |
| `s` | seconds | `00` |
| `p` | offset from UTC (PHP 8) | `-07:00` |
| `;` | plain text | `;` |

So October prints `&10b00-07:00;` and March prints `&3b00-07:00;`.

**Steps to reproduce**

1. Add a CMS Collection and put a Text component inside the item.
2. Type this, with two spaces before `Y`:

```auto
{{item.date_published|date("jS F, Y")}}

```

1. Publish and open the page.

**Expected:** 6th October, 2026  
**Actual:** 6th October,&10b00-07:00; 2026

**Suggested fix**

Leave everything between `{{` and `}}` exactly as typed. Turning extra spaces into `&nbsp;` makes sense for visible text, but inside an expression it changes the code. I’d expect any double space inside an expression to be changed the same way; a date format is just where it shows up.

**Workaround**

Use a single space inside the braces. If you want a wider gap, put the extra space after the closing `}}`, where `&nbsp;` does no harm.

**Check your own sites**

Two CMS templates in my project library (“Posts” and “Single Post”) had the same double space, as `j F Y` with two spaces before `Y`. I don’t know whether I added them or they came from a stock template. If it’s the stock one, a lot of sites could have this. If a date on your site shows something like `&10b00-07:00;`, this is the cause.
