diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 12819a1490238090ae6ff75c11d68a2171fc42be..1e51ba6260948a4d7a8546f37d971fa67393d251 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx Wysiwyg 6.x-2.x, xxxx-xx-xx --------------------------- +#752516 by nquocbao, sun: Fixed file stream warnings in version callbacks. Wysiwyg 6.x-2.1, 2010-03-08 diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc index 696b2cf0074d1c0d72bcba6bfaafa5374151b974..f9eade91a81e65b111029fdb2e63983ed3635e8b 100644 --- a/editors/ckeditor.inc +++ b/editors/ckeditor.inc @@ -60,6 +60,9 @@ function wysiwyg_ckeditor_editor() { */ function wysiwyg_ckeditor_version($editor) { $library = $editor['library path'] . '/ckeditor.js'; + if (!file_exists($library)) { + return; + } $library = fopen($library, 'r'); $max_lines = 8; while ($max_lines && $line = fgets($library, 140)) { diff --git a/editors/fckeditor.inc b/editors/fckeditor.inc index 4243eb9211129a545542880ed91b3b9f5cc2bc68..f3a1b02c56122a91b67b1971464a65bdbd3f81cd 100644 --- a/editors/fckeditor.inc +++ b/editors/fckeditor.inc @@ -52,6 +52,9 @@ function wysiwyg_fckeditor_editor() { */ function wysiwyg_fckeditor_version($editor) { $library = $editor['library path'] . '/fckeditor.js'; + if (!file_exists($library)) { + return; + } $library = fopen($library, 'r'); $max_lines = 100; while ($max_lines && $line = fgets($library, 60)) { diff --git a/editors/jwysiwyg.inc b/editors/jwysiwyg.inc index 3c810e51679edfae08e3d1082ba28abb709f800f..6327ade5111207f5c0e20f8d7cab8d291d9f6f31 100644 --- a/editors/jwysiwyg.inc +++ b/editors/jwysiwyg.inc @@ -48,6 +48,9 @@ function wysiwyg_jwysiwyg_editor() { */ function wysiwyg_jwysiwyg_version($editor) { $script = $editor['library path'] . '/jquery.wysiwyg.js'; + if (!file_exists($script)) { + return; + } $script = fopen($script, 'r'); fgets($script); $line = fgets($script); diff --git a/editors/markitup.inc b/editors/markitup.inc index eb4254ed014c6cb28ae2d280e82d2e9b5c65dbff..944f6ce1591ee9123fa6d8773c4854727fe8420a 100644 --- a/editors/markitup.inc +++ b/editors/markitup.inc @@ -49,6 +49,9 @@ function wysiwyg_markitup_editor() { */ function wysiwyg_markitup_version($editor) { $changelog = $editor['library path'] . '/readme.txt'; + if (!file_exists($changelog)) { + return; + } $changelog = fopen($changelog, 'r'); $line = fgets($changelog); if (preg_match('@([0-9\.]+)@', $line, $version)) { diff --git a/editors/openwysiwyg.inc b/editors/openwysiwyg.inc index 152873bf26b6a1241338929981bdc760b41b4eb4..7f77baae994c915d295234f270542f50ecb6dad5 100644 --- a/editors/openwysiwyg.inc +++ b/editors/openwysiwyg.inc @@ -45,7 +45,10 @@ function wysiwyg_openwysiwyg_editor() { * The installed editor version. */ function wysiwyg_openwysiwyg_version($editor) { - $changelog = $editor['editor path'] . '/changelog'; + $changelog = $editor['library path'] . '/changelog'; + if (!file_exists($changelog)) { + return; + } $changelog = fopen($changelog, 'r'); $line = fgets($changelog, 20); if (preg_match('@v([\d\.]+)@', $line, $version)) { diff --git a/editors/tinymce.inc b/editors/tinymce.inc index d4423fd335cbf14281e740310573c7fcc0b18142..55f6ce3aed277857f53b885563c7772755cbcf8d 100644 --- a/editors/tinymce.inc +++ b/editors/tinymce.inc @@ -82,6 +82,9 @@ function wysiwyg_tinymce_editor() { */ function wysiwyg_tinymce_version($editor) { $script = $editor['library path'] . '/tiny_mce.js'; + if (!file_exists($script)) { + return; + } $script = fopen($script, 'r'); // Version is contained in the first 100 chars. $line = fgets($script, 100); diff --git a/editors/whizzywig.inc b/editors/whizzywig.inc index 6442c9b651edbfe334471d5eaf1da3a91b96595b..9ad9f6f7814828f5541670cab6eaf412840c0a6a 100644 --- a/editors/whizzywig.inc +++ b/editors/whizzywig.inc @@ -46,6 +46,9 @@ function wysiwyg_whizzywig_editor() { */ function wysiwyg_whizzywig_version($editor) { $script = $editor['library path'] . '/whizzywig.js'; + if (!file_exists($script)) { + return; + } $script = fopen($script, 'r'); $line = fgets($script, 43); if (preg_match('@Whizzywig v([0-9]+)@', $line, $version)) { diff --git a/editors/wymeditor.inc b/editors/wymeditor.inc index 47d21cf6272cc37253cd98d5cfa1db3c73fff11b..77b88c2601b39506d13b064c0f4d4b6ced85302e 100644 --- a/editors/wymeditor.inc +++ b/editors/wymeditor.inc @@ -53,6 +53,9 @@ function wysiwyg_wymeditor_editor() { */ function wysiwyg_wymeditor_version($editor) { $script = $editor['library path'] . '/jquery.wymeditor.js'; + if (!file_exists($script)) { + return; + } $script = fopen($script, 'r'); fgets($script); $line = fgets($script); diff --git a/editors/yui.inc b/editors/yui.inc index b2cb56e8c53958b82c8ec8cb1549ef477c20d5cc..258803b270f0f0c70c01baf1ab259e2f70519328 100644 --- a/editors/yui.inc +++ b/editors/yui.inc @@ -66,6 +66,9 @@ function wysiwyg_yui_editor() { */ function wysiwyg_yui_version($editor) { $library = $editor['library path'] . '/editor/editor.js'; + if (!file_exists($library)) { + return; + } $library = fopen($library, 'r'); $max_lines = 10; while ($max_lines && $line = fgets($library, 60)) {