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
6efc45a2
Commit
6efc45a2
authored
8 years ago
by
Dmitry Katsubo
Browse files
Options
Downloads
Patches
Plain Diff
Implemented interwiki substitution for external images (issue #1614).
parent
12762111
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/common.php
+11
-0
11 additions, 0 deletions
inc/common.php
inc/parser/handler.php
+3
-3
3 additions, 3 deletions
inc/parser/handler.php
inc/parser/xhtml.php
+5
-0
5 additions, 0 deletions
inc/parser/xhtml.php
with
19 additions
and
3 deletions
inc/common.php
+
11
−
0
View file @
6efc45a2
...
@@ -834,6 +834,17 @@ function clientismobile() {
...
@@ -834,6 +834,17 @@ function clientismobile() {
return
false
;
return
false
;
}
}
/**
* check if a given link is interwiki link
*
* @param string $link the link, e.g. "wiki>page"
* @return bool
*/
function
link_isinterwiki
(
$link
){
if
(
preg_match
(
'/^[a-zA-Z0-9\.]+>/u'
,
$link
))
return
true
;
return
false
;
}
/**
/**
* Convert one or more comma separated IPs to hostnames
* Convert one or more comma separated IPs to hostnames
*
*
...
...
This diff is collapsed.
Click to expand it.
inc/parser/handler.php
+
3
−
3
View file @
6efc45a2
...
@@ -446,7 +446,7 @@ class Doku_Handler {
...
@@ -446,7 +446,7 @@ class Doku_Handler {
//decide which kind of link it is
//decide which kind of link it is
if
(
preg_match
(
'/^[a-zA-Z0-9\.]+>{1}.*$/u'
,
$link
[
0
])
)
{
if
(
link_isinterwiki
(
$link
[
0
])
)
{
// Interwiki
// Interwiki
$interwiki
=
explode
(
'>'
,
$link
[
0
],
2
);
$interwiki
=
explode
(
'>'
,
$link
[
0
],
2
);
$this
->
_addCall
(
$this
->
_addCall
(
...
@@ -693,8 +693,8 @@ function Doku_Handler_Parse_Media($match) {
...
@@ -693,8 +693,8 @@ function Doku_Handler_Parse_Media($match) {
$cache
=
'cache'
;
$cache
=
'cache'
;
}
}
// Check whether this is a local or remote image
// Check whether this is a local or remote image
or interwiki
if
(
media_isexternal
(
$src
)
)
{
if
(
media_isexternal
(
$src
)
||
link_isinterwiki
(
$src
)
){
$call
=
'externalmedia'
;
$call
=
'externalmedia'
;
}
else
{
}
else
{
$call
=
'internalmedia'
;
$call
=
'internalmedia'
;
...
...
This diff is collapsed.
Click to expand it.
inc/parser/xhtml.php
+
5
−
0
View file @
6efc45a2
...
@@ -1186,6 +1186,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
...
@@ -1186,6 +1186,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*/
*/
function
externalmedia
(
$src
,
$title
=
null
,
$align
=
null
,
$width
=
null
,
function
externalmedia
(
$src
,
$title
=
null
,
$align
=
null
,
$width
=
null
,
$height
=
null
,
$cache
=
null
,
$linking
=
null
,
$return
=
false
)
{
$height
=
null
,
$cache
=
null
,
$linking
=
null
,
$return
=
false
)
{
if
(
link_isinterwiki
(
$src
)){
list
(
$shortcut
,
$reference
)
=
explode
(
'>'
,
$src
,
2
);
$exists
=
null
;
$src
=
$this
->
_resolveInterWiki
(
$shortcut
,
$reference
,
$exists
);
}
list
(
$src
,
$hash
)
=
explode
(
'#'
,
$src
,
2
);
list
(
$src
,
$hash
)
=
explode
(
'#'
,
$src
,
2
);
$noLink
=
false
;
$noLink
=
false
;
$render
=
(
$linking
==
'linkonly'
)
?
false
:
true
;
$render
=
(
$linking
==
'linkonly'
)
?
false
:
true
;
...
...
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