Bug in CobblePage::stdpath
Permalink Browser Info Environment
If any of the searched folders are missing (e.g. single-pages) from the site, CobblePage will start traversing the entire filesystem starting from / (which could account for the execution time exceeded error someone else reported).
Here's the fix:
diff -ruN cobble-ORIG/models/cobble_page.php cobble/models/cobble_page.php
--- cobble-ORIG/models/cobble_page.php 2010-09-12 13:13:20.000000000 -0700
+++ cobble/models/cobble_page.php 2011-07-26 11:20:32.000000000 -0700
@@ -491,7 +491,7 @@
if (!$tpath = realpath($path)) {
$tpath = $path;
}
- return str_replace('\\','/',realpath($tpath));
+ return str_replace('\\','/',$tpath);
}
// List all subdirectories (except ., ..) in the specified directory.)
Here's the fix:
diff -ruN cobble-ORIG/models/cobble_page.php cobble/models/cobble_page.php
--- cobble-ORIG/models/cobble_page.php 2010-09-12 13:13:20.000000000 -0700
+++ cobble/models/cobble_page.php 2011-07-26 11:20:32.000000000 -0700
@@ -491,7 +491,7 @@
if (!$tpath = realpath($path)) {
$tpath = $path;
}
- return str_replace('\\','/',realpath($tpath));
+ return str_replace('\\','/',$tpath);
}
// List all subdirectories (except ., ..) in the specified directory.)
Type: | Discussion |
---|---|
Status: | New |
I just downloaded this, it's version 1.13 according to concrete 5.5.1 (also listed as 1.13 on the marketplace page, 1.14 in the download).
Also, after clicking on the Dashboard -> Cobble link I get the following warning:
Warning: file_get_contents(/home/rollerderby/c551/themes/dashboard/description.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/rollerderby/rollerderbynation.net/packages/cobble/models/cobble_page_theme.php on line 121
Also, after clicking on the Dashboard -> Cobble link I get the following warning:
Warning: file_get_contents(/home/rollerderby/c551/themes/dashboard/description.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/rollerderby/rollerderbynation.net/packages/cobble/models/cobble_page_theme.php on line 121
Hi,
It looks like one of your themes may be missing 'description.txt'. Cobble isn't handling that eventuality very gracefully.
Sorry about the version confusion -- I'll see if I can fix that.
It's getting hard for me to find time to maintain this addon. But I just put the source up at github, in case that helps anyone.
https://github.com/ddrake/cobble...
Please feel free to fork it...
It looks like one of your themes may be missing 'description.txt'. Cobble isn't handling that eventuality very gracefully.
Sorry about the version confusion -- I'll see if I can fix that.
It's getting hard for me to find time to maintain this addon. But I just put the source up at github, in case that helps anyone.
https://github.com/ddrake/cobble...
Please feel free to fork it...
I can't see how it could cause the entire file system to be traversed, though. The glob() function isn't recursive, and I don't believe there's any recursion in my code. If I'm wrong on this, let m know...
Edit: patch applied in version 1.14