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

Open
neonwired opened this issue Apr 25, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@neonwired
Copy link

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

@ryancramerdesign

This comment has been minimized.

Copy link
Contributor

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?

@teppokoivula

This comment has been minimized.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.