Moodle

Can't create wiki with quote in the name

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: None
  • Component/s: Wiki (1.x)
  • Labels:
    None
  • Environment:
    All
  • Affected Branches:
    MOODLE_15_STABLE

Description

When I try to create a wiki with a single quote in the name then I get an error Can't create entry.

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Gustav Delius (gwd2 at york.ac.uk) Sunday, 16 January 2005, 04:47 AM:

The lines

/// If the page has a ' in it, it may have slashes added to it. Remove them if it does.

$page = ($page === false) ? stripslashes(EWIKI_PAGE_INDEX) : stripslashes($page);

in view.php are problematic. If you strip the slashes then you have to add them back before you use $page in database operations. But why strip them in the first place. The standard Moodle way of doing things is to keep them and only strip them when things are printed to the screen.

From Gustav Delius (gwd2 at york.ac.uk) Sunday, 16 January 2005, 05:54 AM:

I had a look and I assume the reason you strip those slashes is that ewiki likes it that way. So I simply added them back in the two places where $page is used in a database operation.

Show
Martin Dougiamas added a comment - From Gustav Delius (gwd2 at york.ac.uk) Sunday, 16 January 2005, 04:47 AM: The lines /// If the page has a ' in it, it may have slashes added to it. Remove them if it does. $page = ($page === false) ? stripslashes(EWIKI_PAGE_INDEX) : stripslashes($page); in view.php are problematic. If you strip the slashes then you have to add them back before you use $page in database operations. But why strip them in the first place. The standard Moodle way of doing things is to keep them and only strip them when things are printed to the screen. From Gustav Delius (gwd2 at york.ac.uk) Sunday, 16 January 2005, 05:54 AM: I had a look and I assume the reason you strip those slashes is that ewiki likes it that way. So I simply added them back in the two places where $page is used in a database operation.
Hide
Michael Blake added a comment -

assign to a valid user

Show
Michael Blake added a comment - assign to a valid user

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: