Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
01e3159c
Commit
01e3159c
authored
15 years ago
by
Chris Tapp
Committed by
Andreas Gohr
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Better performance on assigning section IDs FS#1894
parent
bc87043b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/pageutils.php
+5
-6
5 additions, 6 deletions
inc/pageutils.php
with
5 additions
and
6 deletions
inc/pageutils.php
+
5
−
6
View file @
01e3159c
...
...
@@ -198,7 +198,7 @@ function noNSorNS($id) {
* Creates a XHTML valid linkid from a given headline title
*
* @param string $title The headline title
* @param array $check
List of e
xisting IDs
* @param array $check
E
xisting IDs
(title => number)
* @author Andreas Gohr <andi@splitbrain.org>
*/
function
sectionID
(
$title
,
&
$check
)
{
...
...
@@ -212,12 +212,11 @@ function sectionID($title,&$check) {
if
(
is_array
(
$check
)){
// make sure tiles are unique
$num
=
''
;
while
(
in_array
(
$title
.
$num
,
$check
)){
(
$num
)
?
$num
++
:
$num
=
1
;
if
(
!
array_key_exists
(
$title
,
$check
))
{
$check
[
$title
]
=
0
;
}
else
{
$title
.
=
++
$check
[
$title
];
}
$title
=
$title
.
$num
;
$check
[]
=
$title
;
}
return
$title
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment