wrap globs so that false doesn't blow them up
This commit is contained in:
parent
1f3e3ae38c
commit
5a44c08527
@ -49,6 +49,11 @@ class WhatDidTheySayAdmin {
|
|||||||
// just in case things need to be unit tested...
|
// just in case things need to be unit tested...
|
||||||
function get_filters_dir() { return WP_CONTENT_DIR . '/transcript-filters'; }
|
function get_filters_dir() { return WP_CONTENT_DIR . '/transcript-filters'; }
|
||||||
function _get_abspath() { return ABSPATH; }
|
function _get_abspath() { return ABSPATH; }
|
||||||
|
function _glob($pattern) {
|
||||||
|
$result = glob($pattern);
|
||||||
|
if ($result === false) { $result = array(); }
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the object.
|
* Initialize the object.
|
||||||
@ -108,7 +113,7 @@ class WhatDidTheySayAdmin {
|
|||||||
$filter_to_use = preg_replace('#[^a-z0-9_-]#', '', strtolower($filter_to_use));
|
$filter_to_use = preg_replace('#[^a-z0-9_-]#', '', strtolower($filter_to_use));
|
||||||
|
|
||||||
if (isset($all_filters[$filter_to_use])) {
|
if (isset($all_filters[$filter_to_use])) {
|
||||||
foreach (glob($all_filters[$filter_to_use] . '/*') as $file) {
|
foreach ($this->_glob($all_filters[$filter_to_use] . '/*') as $file) {
|
||||||
if (preg_match('#\.(php|inc)$#', $file) > 0) { $this->override_filter_info['php'] = $file; }
|
if (preg_match('#\.(php|inc)$#', $file) > 0) { $this->override_filter_info['php'] = $file; }
|
||||||
if (preg_match('#\.(css)$#', $file) > 0) { $this->override_filter_info['css'] = $file; }
|
if (preg_match('#\.(css)$#', $file) > 0) { $this->override_filter_info['css'] = $file; }
|
||||||
}
|
}
|
||||||
@ -873,10 +878,10 @@ class WhatDidTheySayAdmin {
|
|||||||
|
|
||||||
foreach ($search_path as $target) {
|
foreach ($search_path as $target) {
|
||||||
if (is_dir($target)) {
|
if (is_dir($target)) {
|
||||||
foreach (glob($target . '/*') as $dir) {
|
foreach ($this->_glob($target . '/*') as $dir) {
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
if (basename($dir) == preg_replace('#[^a-z0-9_-]#', '', strtolower(basename($dir)))) {
|
if (basename($dir) == preg_replace('#[^a-z0-9_-]#', '', strtolower(basename($dir)))) {
|
||||||
foreach (glob($dir . '/*') as $file) {
|
foreach ($this->_glob($dir . '/*') as $file) {
|
||||||
if (preg_match('#^(.*)\.(inc|php)$#', basename($file), $matches) > 0) {
|
if (preg_match('#^(.*)\.(inc|php)$#', basename($file), $matches) > 0) {
|
||||||
$available_filters[basename($dir)] = $dir;
|
$available_filters[basename($dir)] = $dir;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: what-did-they-say 0.9.1\n"
|
"Project-Id-Version: what-did-they-say 0.9.1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2009-10-13 23:03-0400\n"
|
"POT-Creation-Date: 2009-10-14 07:39-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user