Summary
Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04
Recent Commits
>
--git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 8104c0e..fd43149 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -378,5 +378,11 @@ function pts_bool_question($question, $default = true)
return $answer;
}
+function pts_clean_information_string($str)
+{
+ $remove_phrases = array("Corporation ", "Technologies ", "Technology ", "Processor ", "processor ", "Genuine ", "(R)", "(TM)", "(tm)", "Inc. ", "Inc ");
+
+ return str_replace($remove_phrases, "", $str);
+}
?>
diff --git a/pts-core/functions/pts-functions_linux.php b/pts-core/functions/pts-functions_linux.php
index 676b1e5..5d08edd 100644
--- a/pts-core/functions/pts-functions_linux.php
+++ b/pts-core/functions/pts-functions_linux.php
@@ -41,7 +41,7 @@ function processor_string()
$info = file_get_contents("/proc/cpuinfo");
$info = substr($info, strpos($info, "model name"));
$info = trim(substr($info, strpos($info, ":") + 1, strpos($info, "\n") - strpos($info, ":")));
- $info = str_replace(array("Corporation ", "Technologies ", "Processor ", "processor ", "(R)", "(TM)", "(tm)", "Technology "), "", $info);
+ $info = pts_clean_information_string($info);
}
else
$info = "Unknown";
@@ -200,7 +200,7 @@ function parse_lspci_output($desc)
if(($strlen = strlen($info)) < 6 || $strlen > 96)
$info = "N/A";
else
- $info = str_replace(array("Corporation ", "Technologies ", "(R)", "(TM)", "(tm)", "Inc. ", ",", "Technology "), "", $info);
+ $info = pts_clean_information_string($info);
}
&n
Copyright © 2010 by Phoronix Media