Commit 5ada47abcf568c6d6b55892884fb4076f09e74d2

Authored by Megan Watson
1 parent 6a0b22f5

KTS-3039

"The paths in the plugin_helper table can't contain both forward and backward slashes"
Fixed. Modified the function checking the absolute path. On registering the plugin helper, all back slashes are changed to forward slashes.

Committed By: Megan Watson
Reviewed By: Conrad Vermeulen

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8064 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/plugins/plugin.inc.php
... ... @@ -356,12 +356,14 @@ class KTPlugin {
356 356 if (empty($sFilename)) {
357 357 $sFilename = $this->sFilename;
358 358 }
  359 +
359 360 if (!KTUtil::isAbsolutePath($sFilename)) {
360 361 if ($this->sFilename) {
361 362 $sDirPath = dirname($this->sFilename);
362 363 $sFilename = sprintf("%s/%s", $sDirPath, $sFilename);
363 364 }
364 365 }
  366 + $sFilename = str_replace('\\', '/', $sFilename);
365 367 return $sFilename;
366 368 }
367 369  
... ...
lib/util/ktutil.inc
... ... @@ -749,6 +749,11 @@ class KTUtil {
749 749 // {{{ isAbsolutePath
750 750 static function isAbsolutePath($sPath) {
751 751  
  752 + $sPath = str_replace('\\', '/', $sPath);
  753 + $sReal = str_replace('\\', '/', realpath($sPath));
  754 +
  755 + return ($sReal == $sPath);
  756 +
752 757 if (substr($sPath, 0, 1) == '/') {
753 758 return true;
754 759 }
... ...