Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Removing spaces from start of page title #862

neonwired opened this issue Apr 25, 2019 · 5 comments

Bug: Removing spaces from start of page title #862

neonwired opened this issue Apr 25, 2019 · 5 comments


Copy link

@neonwired neonwired commented Apr 25, 2019

It's impossible to remove a space from the start of a page title, the title field seems to strip it when editing the page but when saving it the space remains.

Expected behavior: Either the title field shouldn't strip it or saving the title should save with the space stripped.

ProcessWire version: 3.0.123
PHP version: 7.2

Copy link

@ryancramerdesign ryancramerdesign commented Apr 29, 2019

@neonwired I don't understand how to duplicate the issue you are describing. Can you provide instructions on how to reproduce the issue?

Copy link

@teppokoivula teppokoivula commented May 18, 2019

@ryancramerdesign: not sure if that's the issue @neonwired was facing, but this can happen at least when adding pages via the API. Here's a proof of concept:

<?php namespace ProcessWire;

require 'index.php';

// notice the extra space before "test":
$p = $pages->add('basic-page', 1, [
    'title' => ' test',

// this should output "# test#", which means that the space is still there:
echo "#{$p->title}#\n";

This creates a page with extra space in the beginning of the title. If you edit this page in the Admin, that space is stripped from the title, and as such you cannot remove it – at least not without making some other change to the title as well.

ryancramerdesign added a commit to processwire/processwire that referenced this issue Jul 30, 2021
Copy link

@ryancramerdesign ryancramerdesign commented Jul 30, 2021

Thanks @neonwired @teppokoivula I've pushed a fix for this.

Copy link

@matjazpotocnik matjazpotocnik commented Aug 8, 2021

@neonwired, does Ryan's fix solve the issue for you?

Copy link

@netcarver netcarver commented Aug 16, 2021

Ok, closing this - mention me @neonwired if you need it reopening.

@netcarver netcarver closed this Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants