You are here

function ckeditor_resolve_url in CKEditor - WYSIWYG HTML editor 7

Same name and namespace in other branches
  1. 6 includes/ckeditor.lib.inc \ckeditor_resolve_url()

Emulates the asp Server.mapPath function. Given an url path return the physical directory that it corresponds to.

Returns absolute path or false on failure

Parameters

string $path:

Return value

string|boolean

File

includes/ckeditor.lib.inc, line 90
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_resolve_url($path) {
  if (function_exists('apache_lookup_uri')) {
    $info = @apache_lookup_uri($path);
    if (!$info) {
      return FALSE;
    }
    return $info->filename . $info->path_info;
  }
  $document_root = ckeditor_get_document_root_full_path();
  if ($document_root !== FALSE) {
    return $document_root . $path;
  }
  return FALSE;
}