Skip to content

Commit

Permalink
Fix depreciation warnings on DokuWiki
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomozart committed Jan 30, 2024
1 parent 5ddb29e commit 2cdbcff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion renderer/book.php
Expand Up @@ -123,7 +123,8 @@ function internallink($id, $name = NULL, $returnonly = false) {
// default name is based on $id as given
$default = $this->_simpleTitle($id);
// now first resolve and clean up the $id
resolve_pageid(getNS($ID),$id,$exists);
$resolver = new \dokuwiki\File\PageResolver($ID);
$id = $resolver->resolveId($id);
$name = $this->_getLinkTitle($name, $default, $isImage, $id);

// build the absolute URL (keeping a hash if any)
Expand Down
6 changes: 4 additions & 2 deletions renderer/page.php
Expand Up @@ -1174,7 +1174,8 @@ function _highlight($type, $text, $language=null, $options = null) {
function internalmedia ($src, $title=NULL, $align=NULL, $width=NULL,
$height=NULL, $cache=NULL, $linking=NULL, $returnonly = false) {
global $ID;
resolve_mediaid(getNS($ID),$src, $exists);
$resolver = new \dokuwiki\File\MediaResolver($ID);
$src = $resolver->resolveId($src);
list(/* $ext */,$mime) = mimetype($src);

if ($linking == 'linkonly') {
Expand Down Expand Up @@ -1324,7 +1325,8 @@ function internallink($id, $name = NULL, $returnonly = false) {
// default name is based on $id as given
$default = $this->_simpleTitle($id);
// now first resolve and clean up the $id
resolve_pageid(getNS($ID),$id,$exists);
$resolver = new \dokuwiki\File\PageResolver($ID);
$id = $resolver->resolveId($id);
$name = $this->_getLinkTitle($name, $default, $isImage, $id);

// build the absolute URL (keeping a hash if any)
Expand Down

0 comments on commit 2cdbcff

Please sign in to comment.