cvs: doc-editor / error_type.php /php ToolsError.php

From: Date: Sat, 09 May 2009 21:00:56 +0000
Subject: cvs: doc-editor / error_type.php /php ToolsError.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3996@lists.php.net to get a copy of this message
yannick Sat May 9 21:00:56 2009 UTC Modified files: /doc-editor/php ToolsError.php /doc-editor error_type.php Log: - fix xlink check http://cvs.php.net/viewvc.cgi/doc-editor/php/ToolsError.php?r1=1.12&r2=1.13&diff_format=u Index: doc-editor/php/ToolsError.php diff -u doc-editor/php/ToolsError.php:1.12 doc-editor/php/ToolsError.php:1.13 --- doc-editor/php/ToolsError.php:1.12 Mon May 4 20:33:16 2009 +++ doc-editor/php/ToolsError.php Sat May 9 21:00:55 2009 @@ -484,7 +484,7 @@ function attributLinkTag() { - $reg = '/<link\s*?xlink:href="(.*?)">/s'; + $reg = '/<link\s*?xlink:href=\s*?"(.[^"]*?)"(\s*|\s*?\/)?>/s'; $match = $en_xlink = array(); preg_match_all($reg, $this->en_content, $match); @@ -496,10 +496,10 @@ for ($i = 0; $i < count($en_xlink); $i++) { - if (!isset($en_xlink[$i]) ) { $en_xlink[$i] = ''; } - if (!isset($lang_xlink[$i])) { $lang_xlink[$i] = ''; } + if( !in_array($en_xlink[$i], $lang_xlink) ) { + + if (!isset($lang_xlink[$i])) { $lang_xlink[$i] = ''; } - if ($en_xlink[$i] != $lang_xlink[$i] ) { $this->addError(array( "value_en" => $en_xlink[$i], "value_lang" => $lang_xlink[$i], @@ -507,8 +507,20 @@ )); } + } + if( count($en_xlink) < count($lang_xlink) ) { + + $this->addError(array( + "value_en" => count($en_xlink), + "value_lang" => count($lang_xlink), + "type" => "NbLink" + )); + + } + + $reg = '/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s'; $en_linkend = array(); http://cvs.php.net/viewvc.cgi/doc-editor/error_type.php?r1=1.12&r2=1.13&diff_format=u Index: doc-editor/error_type.php diff -u doc-editor/error_type.php:1.12 doc-editor/error_type.php:1.13 --- doc-editor/error_type.php:1.12 Mon Apr 20 16:28:55 2009 +++ doc-editor/error_type.php Sat May 9 21:00:56 2009 @@ -98,6 +98,7 @@ 'productname' => 'Productname', 'simpara' => 'Simpara', 'tip' => 'Tip', + 'userinput' => 'Userinput', 'varname' => 'Varname', 'warning' => 'Warning' ); @@ -157,6 +158,9 @@ $error['attributXlinkLink']['head'] = 'Linkend and xlink tags'; $error['attributXlinkLink']['desc'] = 'Throw if the value of the attribut <b>xlink:href</b> is different from english version.'; +$error['NbLink']['head'] = 'Linkend and xlink tags'; +$error['NbLink']['desc'] = 'Throw if the number of <b>Link</b> tags is different from english version.'; + $error['errorRoleMethodsynopsis']['head'] = 'Methodsynopsis tag'; $error['errorRoleMethodsynopsis']['desc'] = 'Throw if the value of the attribut <b>role</b> is different from english version.'; $error['errorOptionalMethodsynopsis']['head'] = 'Methodsynopsis tag';

« previous php.doc.cvs (#3996) next »