Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Excluded .svn dirs as CMS extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
luis.leiva.torres committed Mar 27, 2012
1 parent b469847 commit 52a6672
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions admin/sys/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function ext_available()
{
while (false !== ($file = readdir($handle))) {
// look for available module extensions
if ($file != "." && $file != ".." && is_dir($dir.'/'.$file)) {
if (!str_startswith($file, ".") && is_dir($dir.'/'.$file)) {
$ext[] = $file;
}
}
Expand Down Expand Up @@ -511,7 +511,7 @@ function count_dir_files($dir)
$count = 0;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && is_file($dir.'/'.$file)) {
if (!str_startswith($file, ".") && is_file($dir.'/'.$file)) {
$count++;
}
}
Expand Down Expand Up @@ -647,6 +647,7 @@ function die_msg($text = "")
* Pad with zeros a number.
* @param int $num input number
* @param int $numZeros number of zeros
* @return string
*/
function pad_number($num, $numZeros)
{
Expand Down Expand Up @@ -685,7 +686,7 @@ function unregister_GLOBALS()

/**
* Gets a SQL-like string with all cache IDs that are related to the same URL.
* @param int Log cache ID
* @param int $pageId Log cache ID
* @return string SQL query
*/
function get_cache_common_url($pageId)
Expand All @@ -703,4 +704,15 @@ function get_cache_common_url($pageId)

return $merge;
}

/**
* Checks if a strnig starts with a certain prefix.
* @param $string string source string
* @param $prefix string prefix to find
* @return boolean TRUE on success or FALSE on failure
*/
function str_startswith($str, $prefix)
{
return strncmp($str, $prefix, strlen($prefix)) == 0;
}
?>

0 comments on commit 52a6672

Please sign in to comment.