Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
59d5c779
Commit
59d5c779
authored
Mar 21, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dots in Wiki slug causing errors
Closes #1263, #431
parent
aadd38db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
2 deletions
+45
-2
CHANGELOG
CHANGELOG
+1
-0
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
app/models/wiki_page.rb
app/models/wiki_page.rb
+2
-1
spec/models/wiki_page_spec.rb
spec/models/wiki_page_spec.rb
+41
-0
No files found.
CHANGELOG
View file @
59d5c779
Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
- Fix dots in Wiki slugs causing errors (Stan Hu)
- Update poltergeist to version 1.6.0 to support PhantomJS 2.0 (Zeger-Jan van de Weg)
- Fix cross references when usernames, milestones, or project names contain underscores (Stan Hu)
- enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger)
...
...
app/models/project_wiki.rb
View file @
59d5c779
...
...
@@ -104,7 +104,7 @@ class ProjectWiki
def
page_title_and_dir
(
title
)
title_array
=
title
.
split
(
"/"
)
title
=
title_array
.
pop
[
title
.
gsub
(
/\.[^.]*$/
,
""
)
,
title_array
.
join
(
"/"
)]
[
title
,
title_array
.
join
(
"/"
)]
end
def
search_files
(
query
)
...
...
app/models/wiki_page.rb
View file @
59d5c779
...
...
@@ -179,7 +179,8 @@ class WikiPage
if
valid?
&&
project_wiki
.
send
(
method
,
*
args
)
page_details
=
if
method
==
:update_page
@page
.
path
# Use url_path instead of path to omit format extension
@page
.
url_path
else
title
end
...
...
spec/models/wiki_page_spec.rb
View file @
59d5c779
...
...
@@ -78,6 +78,47 @@ describe WikiPage do
end
end
describe
"dot in the title"
do
let
(
:title
)
{
'Index v1.2.3'
}
before
do
@wiki_attr
=
{
title:
title
,
content:
"Home Page"
,
format:
"markdown"
}
end
describe
"#create"
do
after
do
destroy_page
(
title
)
end
context
"with valid attributes"
do
it
"saves the wiki page"
do
subject
.
create
(
@wiki_attr
)
expect
(
wiki
.
find_page
(
title
)).
not_to
be_nil
end
it
"returns true"
do
expect
(
subject
.
create
(
@wiki_attr
)).
to
eq
(
true
)
end
end
end
describe
"#update"
do
before
do
create_page
(
title
,
"content"
)
@page
=
wiki
.
find_page
(
title
)
end
it
"updates the content of the page"
do
@page
.
update
(
"new content"
)
@page
=
wiki
.
find_page
(
title
)
end
it
"returns true"
do
expect
(
@page
.
update
(
"more content"
)).
to
be_truthy
end
end
end
describe
"#update"
do
before
do
create_page
(
"Update"
,
"content"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment